Part Number Hot Search : 
VW193 00M200V ON2522 FZ1200 25001 RTL8208 PDTC124 HEF4000
Product Description
Full Text Search
 

To Download FDC37N958FR Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  smsc ds ? FDC37N958FR rev. 09/01/99 FDC37N958FR notebook i/o controller with enhanced keyboard and system control features ! 5 volt operation ! acpi 1.0 compliant ! pc 99 compliant ! three power planes ! <20 " a consumption in sleep mode ! configuration register set compatible with isa plug-and-play standard (version 1.0a) ! serial irq meets irq specification for pci systems - quiet (active) mode - continuous (idle) mode ! 8051 controller uses parallel port to reprogram the flash rom ! ir interface fully compliant to irda 1.1 (fast ir) - temic/ibm module support - hp module support - sharp module support ! isa host interface - 16 bit address qualification - 8 bit data bus - zero wait-state i/o register access - all write only registers are shadowed - iochrdy for ecp and flash cycles - 8 direct irqs including nsmi - four 8 bit dma channels ! system flash interface (256kx8) - 8051/host cpu multiplexed interface - eight 32k pages - 8051 keyboard bios - four 64k pages - host system bios ! 8051 keyboard and system controller - provides system power management - system watch dog timer (wdt) - 8042 style host interface - asynchronous access to two data registers and one status register - supports interrupt and polling access - 2k internal rom, nea pin select - 32k bank switchable external flash rom interface - 256 bytes data ram - access to on-chip control registers via movx external data access commands - access to rtc and cmos registers - up to 16x8 keyboard scan matrix - two 16 bit timer/counter - integrated tx/rx serial interface - six 8051 interrupt sources - sixteen 8 bit, host/8051 mailbox registers - 19 maskable hardware wake-up events supported - fast gatea20 - fast cpu_reset - multiple clock sources and frequencies - idle and sleep modes ! real time clock - mc146818 and ds1287 compatible - 256 bytes of battery backed cmos in two banks of 128 bytes - 128 bytes of cmos ram lockable in 4x32 byte blocks - 12 and 24 hour time format - binary and bcd format -<1 " a standby current (typ) ! access.bus interface - 8584 style interface ! ps/2 ports
smsc ds ? FDC37N958FR rev. 09/01/99 - four independent hardware driven ports ! general purpose i/o - 22 i/o pins - 12 out pins - 8 in pins ! two pulse width modulators - independent clock rates - 7 bit duty cycle granularity ! intelligent auto power management ! 2.88mb super i/o floppy disk controller - relocatable to 480 different addresses - 13 irq options - 4 dma options - open drain / push-pull configurable output drivers - licensed cmos 765b floppy disk controller - advanced digital data separator - software and register compatible with smsc's proprietary 82077aa compatible core - sophisticated power control circuitry (pcc) including multiple powerdown modes for reduced power consumption - supports two floppy drives directly - 24 ma at bus drivers - low power cmos design ! floppy disk interface on parallel port ! licensed cmos 765b floppy disk controller core - supports vertical recording format - 16 byte data fifo - 100% ibm? compatibility - detects all overrun and underrun conditions - 48 ma drivers and schmitt trigger inputs - dma enable logic - data rate and drive control registers ! enhanced digital data separator - low cost implementation - no filter components required - 2 mbps, 1 mbps, 500 kbps, 300 kbps, 250 kbps data rates - programmable precompensation modes ! multi-mode # parallel port with chiprotect # - relocatable to 480 different addresses - 13 irq options - 4 dma options - enhanced mode - standard mode: - ibm pc/xt ? , pc/at ? , and ps/2 # compatible bidirectional parallel port - enhanced parallel port (epp) compatible - epp 1.7 and epp 1.9 (ieee 1284 compliant) - high speed mode - microsoft and hewlett packard extended capabilities port (ecp) compatible (ieee 1284 compliant) - incorporates chiprotect # circuitry for protection against damage due to printer power-on - 12 ma output drivers ! serial ports - relocatable to 480 different addresses - 13 irq options - two high speed ns16c550a compatible uarts with send/receive 16 byte fifos - programmable baud rate generator - modem control circuitry including 230k and 460k baud - irda, hp-sir, ask-ir support ibm, pc/xt and pc/at are registered trademarks and ps/2 is a trademark of international business machines corporation. smsc is a registered trademark and ultra i/o, chiprotect, and multi-mode are trademarks of standard microsystems corporation ordering information order number: FDC37N958FRtqfp 208 pin qfp/tqfp package options
smsc ds ? FDC37N958FR rev. 09/01/99 table of contents general description ............................................................................................................ .......... 1 pin configuration .............................................................................................................. .............. 2 description of pin functions ................................................................................................... ... 3 alternate function pin list .................................................................................................... .. 10 buffer type descriptions ....................................................................................................... ... 12 functional description......................................................................................................... ...... 13 auto power management.......................................................................................................... .. 17 floppy disk controller ......................................................................................................... .... 23 fdc instruction set ............................................................................................................ .......... 50 fdc data transfer commands .................................................................................................. 62 fdc control commands ........................................................................................................... .... 71 compatibility .................................................................................................................. ................. 77 serial port (uart)............................................................................................................. ............. 80 register description ........................................................................................................... ........ 80 programmable baud rate generator .................................................................................. 89 fifo interrupt mode operation................................................................................................ 91 fifo polled mode operation..................................................................................................... .91 notes on serial port fifo mode operation ........................................................................ 96 infrared communications controller (ircc) .................................................................... 98 irrx/irtx pin enable........................................................................................................... ............ 99 ir registers - logical device 5 ............................................................................................... 1 00 ir dma channels................................................................................................................ ............ 101
smsc ds ? FDC37N958FR rev. 09/01/99 ir irqs........................................................................................................................ ........................ 101 parallel port .................................................................................................................. ............. 102 parallel port interface multiplexor ............................................................................... 124 host (legacy) parallel port interface (FDC37N958FR standard)............................ 125 parallel port fdc interface ................................................................................................. 125 parallel port - 8051 control (FDC37N958FR standard) ................................................ 126 8051 embedded controller...................................................................................................... 1 27 features....................................................................................................................... ................... 127 8051 functional overview....................................................................................................... .. 127 8051 memory map ................................................................................................................ ........... 131 8051 control registers......................................................................................................... .... 136 watch dog timer................................................................................................................ ........... 151 shared flash interface......................................................................................................... ... 153 8051 system power management ............................................................................................ 158 keyboard controller ............................................................................................................ ... 168 mailbox register interface .................................................................................................... 1 81 ps/2 interface description..................................................................................................... .. 184 access.bus interface description ....................................................................................... 185 led controls ................................................................................................................... .............. 189 pulse width modulators ......................................................................................................... .190 real time clock cmos access................................................................................................. 190 8051 controlled parallel port ............................................................................................ 193 8051 controlled ir port........................................................................................................ .... 196
smsc ds ? FDC37N958FR rev. 09/01/99 general purpose i/o (gpio) ..................................................................................................... .. 197 multiplexed pins ............................................................................................................... ........... 203 real time clock ................................................................................................................ ............ 209 vcc1 por....................................................................................................................... .................... 211 internal registers ............................................................................................................. ........ 212 time calendar and alarm ........................................................................................................ .213 update cycle ................................................................................................................... .............. 214 control and status registers .............................................................................................. 215 interrupts ..................................................................................................................... ................. 220 frequency divider .............................................................................................................. ......... 220 periodic interrupt selection ................................................................................................. 22 0 power management............................................................................................................... ...... 221 access.bus..................................................................................................................... ................. 222 background ..................................................................................................................... .............. 222 register description ........................................................................................................... ...... 223 ps/2 device interface.......................................................................................................... ........ 229 ps/2 logic overview............................................................................................................ ......... 229 serial interrupts .............................................................................................................. .......... 233 FDC37N958FR configuration ..................................................................................................... 2 38 configuration elements......................................................................................................... .. 238 typical sequence of configuration operation.............................................................. 239 configuration registers ........................................................................................................ .241 open mode registers............................................................................................................ ...... 266
smsc ds ? FDC37N958FR rev. 09/01/99 electrical specifications...................................................................................................... .. 269 load capacitance ............................................................................................................... ......... 274 timing diagrams ................................................................................................................ ............ 275 functional revision addendum .............................................................................................. 308 FDC37N958FR errata sheet....................................................................................................... .309
smsc ds ? FDC37N958FR page 1 rev. 09/01/99 general description the FDC37N958FR is compliant with acpi 1.0 and pc 97 and incorporates an 8051 based keyboard controller; a flash interface; four ps/2 ports; real-time clock; smsc's true cmos 765b fdc with advanced digital data separator and 16 byte data fifo; two 16c550a compatible uarts, the second uart contains a synchronous communications engine to provide for irda ver 1.1 (fast ir) compliance; one multi-mode parallel port which includes chiprotect tm circuitry plus epp and ecp support; 8584 style access bus interface; serial irq peripheral agent interface; general purpose i/o; two independent pulse width modulators; on-chip 24 ma at bus drivers and two floppy direct drive support. the true cmos 765b core provides 100% compatibility with ibm pc/xt and pc/at architectures in addition to providing data overflow and underflow protection. the smsc advanced digital data separator incorporates smsc's patented data separator technology, allowing for ease of testing and use. both on-chip uarts are compatible with the ns16c550a. the parallel port is compatible with ibm pc/at architecture, as well as epp and ecp. the 8051 controller can also take control of the parallel port interface to provide remote diagnostics or ?flashing? of the flash memory. the FDC37N958FR has three separate power planes which allows it to provide ?instant on? and system power management functions. additionally, the FDC37N958FR incorporates sophisticated power control circuitry (pcc). the pcc supports multiple low power down modes. the FDC37N958FR?s configuration register set is compatible with the isa plug-and-play standard (version 1.0a) and provides the functionality to support windows '95. through internal configuration registers, each of the FDC37N958FR's logical device's i/o address, dma channel and irq channel may be programmed. there are 480 i/o address location options, 13 irq options, and 4 dma channel options for each logical device. the FDC37N958FR does not require any external filter components and is, therefore, easy to use and offers lower system cost and reduced board area. the FDC37N958FR is software and register compatible with smsc's proprietary 82077aa core.
smsc ds ? FDC37N958FR page 2 rev. 09/01/99 pin configuration figure 1 - FDC37N958FR pin configuration xosel xtal1 xtal2 agnd fad0 fad1 fad2 fad3 fad4 fad5 gnd fad6 fad7 fa8 fa9 fa10 fa11 fa12 fa13 vcc1 fa14 fa15 fa16 fa17 fale nfrd nfwr gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7 gnd nea mode ab_data ab_clk nbat_led nfdd_led out11 out10 out9 out8 irrx irtx vcc2 gpio17 gpio18 gpio19 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 vcc1_pwgd nreset_out gnd 32khz_out 24mhz_out npwr_led pwrgd slct pe busy nack pd7 pd6 pd5 pd4 vcc2 pd3 pd2 pd1 pd0 nslctin ninit nerror nalf nstb rxd1 txd1 gnd ndsr1 nrts1 ncts1 ndtr1 ndcd1 nri1 gpio15 gpio14 gpio8 gpio9 vcc1 gpio13 gpio10 gpio11 gpio12 in0 in1 in2 in3 in4 in5 in6 in7 vcc0 155 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 156 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 vcc2 clocki out7 sirq psbdat psbclk nmemwr nmemrd nromcs iochrdy tc drq1 ndack1 drq0 ndack0 gnd sd7 sd6 sd5 sd4 sd3 vcc2 sd2 sd1 sd0 aen niow nior nnows out4 out3 gnd out2 out1 out0 sa15 sa14 sa13 sa12 sa11 sa10 sa9 sa8 sa7 sa6 sa5 sa4 sa3 sa2 sa1 sa0 gpio21 gnd out5 out6 drvden0 drvden1 nmtr0 gnd nds0 ndir nstep nwdata nwgate nhdsel nindex ntrk0 nwprot nrdata ndskchg mid_0 gpio16 fpd kso13 kso12 kso11 kso10 kso9 kso8 kso7 vcc2 kso6 kso5 kso4 kso3 kso2 kso1 kso0 ksi7 ksi6 ksi5 ksi4 ksi3 ksi2 ksi1 ksi0 emclk emdat imclk imdat gnd kbclk kbdat gpio20 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 FDC37N958FR 208 pin pqfp/tqfp
smsc ds ? FDC37N958FR page 3 rev. 09/01/99 description of pin functions pinpin pin # name description supply voltage type host (isa) interface 80:82, 84:88 sd[0:7] system data bus vcc2 i/o24 54:69 sa[0:15] system address bus vcc2 i 96 nromcs rom chip select vcc2 i 79 aen address enable (dma master has bus control) vcc2 i 95 iochrdy i/o channel ready vcc2 od24 91,93 drq[0:1] dma requests vcc2 o24 202, 201 drq[2:3]/ out[8:9] dma requests/gp outputs vcc2 o24 90, 92 ndack[0:1] dma acknowledge vcc2 i 207, 208 ndack[2:3]/ gpio18, 19 dma acknowledge/gpio 18,19 vcc2 i/io8 94 tc terminal count vcc2 i 77 nior i/o read vcc2 i 78 niow i/o write vcc2 i 97 nmemrd memory read vcc2 i 98 nmemwr memory write vcc2 i 70 irq6(fdc)/ out0 floppy disk interrupt request/ generic output 0 vcc2 o24 71 nirq8/ out1 active low interrupt request 8/ generic output 1 vcc2 o24 72 irq7(pp)/ out2 parallel port interrupt request/ generic output 2 vcc2 o24 74 irq12(m)/ out3 mouse interrupt request/ generic output 3 vcc2 o24 75 irq1(kb)/ out4 keyboard interrupt request/ generic output 4 vcc2 o24 76 nnows no wait state vcc2 od24 flash rom/ memory map interface 161:166, 168:169 fad[7:0] flash address/data[7:0] bus vcc1 i/o8 170:175, 177:180 fa[8:17] flash address[17:8] vcc1 o8 182 nfrd flash memory read vcc1 o8
smsc ds ? FDC37N958FR page 4 rev. 09/01/99 description of pin functions pinpin pin # name description supply voltage type 183 nfwr flash memory write vcc1 o8 181 fale flash address latch enable vcc1 o8 keyboard 36:30, 28:22 kso[0:13] keyboard scan outputs(14*8 = 112) configuring gpio4 and gpio5 as kso14 and kso15 yields a scan matrix of 16 x 8 = 128. vcc1 od4 44:37 ksi[0:7] keyboard scan inputs vcc1 isp 193 nea external access for 2k rom vcc1 i 45 emclk em serial clock vcc2 i/od 24 46 emdat em serial data vcc2 i/od 24 47 imclk im serial clk vcc2 i/od 24 48 imdat im serial data vcc2 i/od 24 50 kbclk kbd serial clock vcc2 i/od 24 51 kbdat kbd serial data vcc2 i/od 24 52 ps2clk/ 8051rx/ gpio[20] ps2 serial clock vcc2 i/od24 53 ps2dat/ 8051tx/ gpio[21] ps2 serial data vcc2 i/od24 serial irq / uart irqs 101 sirq / irq3(ua1) serial interrupt uart1 interrupt vcc2 i/o24 /o24 99 psbclk pci clock input vcc2 i 100 psbdat uart2 interrupt vcc2 i/o24 /o24 fdd interface the following fdc output pins can be configured as either open drain outputs capable of sinking 24ma (od24) or as push-pull outputs capable of driving 12ma and sinking 24ma (o24). the fdc output pins must tristate when the fdc is in powerdown mode (the board designer must provide external pull-up resistors on these output pins). 17 nrdata read disk data vcc2 is 12 nwgate write gate vcc2 o24/ od24 11 nwdata write disk data vcc2 o24/ od24
smsc ds ? FDC37N958FR page 5 rev. 09/01/99 description of pin functions pinpin pin # name description supply voltage type 13 nhdsel head select (1 = side 0 ) vcc2 o24/ od24 9 ndir step direction (1 = out ) vcc2 o24/ od24 10 nstep step pulse vcc2 o24/ od24 18 ndskchg disk change vcc2 is 8 nds0 drive select 0 vcc2 o24 / od24 6 nmtr0 motor on 0 vcc2 o24 / od24 2nds1/ out5 drive select 1/ output 5 vcc2 o24 / od24/ o24 3nmtr1/ out6 motor on 1/ output 6 vcc2 o24 / od24 o24 16 nwprot write protected vcc2 is 15 ntrk0 track 0 vcc2 is 14 nindex index pulse input vcc2 is 4:5 drvden[0:1] drive density select [0:1] vcc2 o24 / od24 19 mid[0] media id 0 input. in floppy enhanced mode 2 this input is the media id [0] input. vcc2 is 20 mid[1]/ gpio16 media id 1 input. in floppy enhanced mode 2 this input is the media id [1] input. general purpose i/o vcc2 is i/o8 21 fpd floppy power down output control. this is the output of three power down modes of the floppy (3f4, auto-power down, configuration). vcc2 o8 serial port 1 interface 130 rxd1 receive serial data 1 vcc2 i 131 txd1 transmit serial data 1 vcc2 o4 134 nrts1 request to send 1 vcc2 o4 135 ncts1 clear to send 1 vcc2 i 136 ndtr1 data terminal ready 1 vcc2 o4
smsc ds ? FDC37N958FR page 6 rev. 09/01/99 description of pin functions pinpin pin # name description supply voltage type 133 ndsr1 data set ready 1 vcc2 i 137 ndcd1 data carrier detect 1 vcc2 i 138 nri1 ring indicator 1 vcc1 i serial port 2 interface 141 rxd2/ gpio8 receive serial data 2/ general purpose i/o 8 vcc1 i / i/o8 142 txd2/ gpio9 transmit serial data 2/ general purpose i/o 9 vcc1 o8/ i/o8 145 nrts2/ gpio10 request to send 2/ general purpose i/o 10 vcc1 o8/ i/o8 146 ncts2/ gpio11 clear to send 2/ general purpose i/o 11 vcc1 i/ i/o8 147 ndtr2/ gpio12 data terminal ready 2/ general purpose i/o 12 vcc1 o8/ i/o8 144 ndsr2/ gpio13 data set ready 2/ general purpose i/o 13 vcc1 i/ i/o8 140 ndcd2/ gpio14 data carrier detect 2/ general purpose i/o 14 vcc1 i/ i/o8 139 nri2 / gpio15 ring indicator 2/ general purpose i/o 15 vcc1 i / i/o8 parallel port interface 124:121, 119:116 pd[0:7] parallel port data bus vcc2 i/o24 125 nslctin printer select vcc2 od24/ o24 126 ninit initiate output vcc2 od24/ o24 128 nalf auto line feed vcc2 od24/ o24 129 nstb strobe signal vcc2 od24/ o24 114 busy busy signal vcc2 i 115 nack acknowledge handshake vcc2 i 113 pe paper end vcc2 i 112 slct printer selected vcc2 i 127 nerror error at printer vcc2 i rtc
smsc ds ? FDC37N958FR page 7 rev. 09/01/99 description of pin functions pinpin pin # name description supply voltage type 158 xtal1 32 khz crystal input vcc0 iclk2 159 xtal2 32 khz crystal output vcc0 oclk2 miscellaneous 102 nsmi/ out7 system management interrupt/ output 7 vcc2 o24 108 32 khz_out 32 khz out -- the 32 khz output is enabled / disabled by setting / clearing bit-0 of the output enable 8051 memory mapped register. when disabled the 32 khz_out pin is driven low. the 32 khz_out pin defaults to the disabled state on vcc1 por. vcc1 o8 109 24 mhz_out programmable clock output. 1.8432 mhz (default = 24 mhz/13) 14.318 mhz 16 mhz 24 mhz 48 mhz vcc2 o24 103 clocki 14.318 mhz clock input vcc2 iclk 195 ab_data access.bus serial data vcc1 i/od8 196 ab_clk access.bus clock vcc1 i/od8 194 mode set configuration register address vcc1 i 157 xosel test mode enable input pin. xosel = 1 is required to qualify all pin defined test modes. xosel = 0 prevents the pin test modes from ever being invoked. vcc1 i 203 irrx infared receive vcc2 i 204 irtx infared transmit vcc2 o8 200 pwm0/ out10 pulse width modulator 0/ output 10 vcc2 o24 199 pwm1/ out11 pulse width modulator 1/ output 11 vcc2 o24
smsc ds ? FDC37N958FR page 8 rev. 09/01/99 description of pin functions pinpin pin # name description supply voltage type 105 vcc1_pwgd vcc1 power good input pin. the trailing edge of vcc1 por is released 20ms from the assertion of this pin. if this pin is pulled low while vcc1 is valid, then vcc1 por will be asserted and held until 20ms from re-assertion of this pin. this pin has an internal weak (90 " a) pull-up to vcc1. vcc1 i 106 nreset_out system reset (active low) vcc2 o8 197 nbat_led battery led (0=on) vcc1 od24 110 npwr_led power led (0=on) vcc1 od24 198 nfdd_led floppy led. this pin is asserted whenever either drvsel1 or drvsel0 is asserted or controlled by the 8051. (0 = on) vcc1 od24 111 pwrgd powergood vcc2 i 148 wk_ee4/in0 wakeup event/generic input 0 vcc1 i 149 wk_ee2/in1 wakeup event/generic input 1 vcc1 i 150 wk_ee3/in2 wakeup event/generic input 2 vcc1 i 151 ngpwkup/ in3 wakeup event/generic input 3 vcc1 i 152 wk_hl1/in4 wakeup event/generic input 4 vcc1 i 153 wk_hl2/in5 wakeup event/generic input 5 vcc1 i 154 wk_hl6/in6 wakeup event/generic input 6 vcc1 i 155 wk_ee1/in7 wakeup event/generic input 7 vcc1 i 184 wk_hl3/ gpio0 wakeup event/ gp i/o 0 vcc1 i / i/o8 185 wk_hl4/ gpio1 wakeup event/ gp i/o 1 vcc1 i / i/o8 186 wk_hl5/ gpio2 wakeup event/ gp i/o 2 vcc1 i / i/o8 187 trigger/ gpio3 interrupt 1 event/ gp i/o 3 vcc1 i/ i/o8
smsc ds ? FDC37N958FR page 9 rev. 09/01/99 table 1 - power pin list bias pins 156 vcc0 rtc supply voltage 143,176 vcc1 8051 + ab +4.7v supply voltage (note) 29,83,104, 120,205 vcc2 core +5v supply voltage 160 agnd analog ground for vcc0. 1, 7, 49, 73, 89, 107, 132, 167, 192 gnd ground note: ab = access.bus
smsc ds ? FDC37N958FR page 10 rev. 09/01/99 alternate function pin list table 2 - alternate function pin list function i/o type pin number default alternate default alternate mux control vcc plane 70 out0 irq6 (fdc) o24 o24 misc0 vcc2 71 out1 nirq8 o24 o24 72 out2 irq7 (pp) o24 o24 74 out3 irq12(mouse) o24 o24 75 out4 irq1(kbd) o24 o24 2out5 nds1 o24 o24/od24 misc5 3out6 nmtr1 o24 o24/od24 102 out7 nsmi o24 o24 misc0 202 out8 drq2 (note1) | cpu_reset o24 o24 misc10 + misc6 201 out9 drq3 (note1) o24 o24 misc11 200 out10 pwm0 o24 o24 misc4 199 out11 pwm1 o24 o24 148 in0 wk_ee4 i i alternate vcc1 149 in1 wk_ee2 i i input masked 150 in2 wk_ee3 i i by wake-up mask register bits 151 in3 ngpwkup i i 152 in4 wk_hl1 i i 153 in5 wk_hl2 i i 154 in6 wk_hl6 i i 155 in7 wk_ee1 i i 184 gpio0 wk_hl3 i/o8 i vcc1 185 gpio1 wk_hl4 i/o8 i 186 gpio2 wk_hl5 i/o8 i 187 gpio3 trigger i/o8 i masked by int1 mask register bit 3 188 gpio4 kso14 i/o8 od8 misc9 189 gpio5 kso15 i/o8 od8 190 gpio6 ir_mode | frx i/o8 o8 | i misc[14:13] 191 gpio7 i/o8 141 gpio8 com-rx i/o8 imisc7 142 gpio9 com-tx i/o8 o8 (note2) 145 gpio10 nrts2 | ir_mode | frx i/o8 o8 | o8 | i (note1) misc[16:15] 146 gpio11 ncts2 i/o8 imisc12 147 gpio12 ndtr2 i/o8 o8 (note2) 144 gpio13 ndsr2 i/o8 i 140 gpio14 ndcd2 i/o8 i
smsc ds ? FDC37N958FR page 11 rev. 09/01/99 function i/o type pin number default alternate default alternate mux control vcc plane 139 gpio15 nri2 i/o8 i 20 gpio16 mid1 is/o8 is misc8 vcc2 206 gpio17 gatea20 i/o8 o8 misc6 207 gpio18 ndack2 (note1) i/o8 imisc17 208 gpio19 ndack3 (note1) i/o8 imisc11 52 gpio20 ps2clk | 8051rx i/od24 i/od24 | i misc1 + 53 gpio21 ps2dat | 8051tx i/od24 i/od24 | od24 misc3 101 sirq irq3 (ua1) o8 o8 misc0 23 kso12 out8 od4 od4 misc17 + 6 vcc1 22 kso13 gpio18 od4 od4 misc17 note 1: with the inclusion of fast ir two additional dma channels are provided. note 2: when gpio6, gpio9, gpio10 and/or gpio12 are configured as ir_mode, com- tx, nrts2|ir_mode, and/or ndtr2 respectively and powergood=0 (vcc2 low) then these pins will tri-state to prevent back-biasing of external circuitry. the mux control column in table 2 lists the misc bits which the 8051 has access to through the three multiplexing registers. see the 8051 section of this data sheet for a description of the multiplexing registers.
smsc ds ? FDC37N958FR page 12 rev. 09/01/99 buffer type descriptions i input, ttl compatible. is input with schmitt trigger isp input with schmitt trigger, 90ua pull-up. iclk input to crystal oscillator circuit (cmos levels) iclk2 crystal input oclk2 output to external crystal o4 output, 4ma sink, 2ma source. o8 output, 8ma sink, 4ma source. od8 open drain output, 8ma sink. o8sr output, 8ma sink, 4ma source with slew rate limiting o16 output, 16ma sink, 8ma source. od16 open drain output, 16ma sink. o24 output, 24ma sink, 12ma source. od24 open drain output, 24ma sink. od48 open drain output, 48ma sink
smsc ds ? FDC37N958FR page 13 rev. 09/01/99 functional description figure 2 - functional block diagram *1 -- gpio pin multiplexed option *2 -- out pin multiplexed option *3 -- muxed with sirq and psbdata pins smsc proprietary 82077 compatible vertical floppy disk controller core ndskchg, nwprot, ntrk0, nindex, mid0, mid1(*1) nwgate, nhdsel, ndir, nstep, nds0, nds1 (*2), nmtr0, nmrt1 (*2), drvden0, drvden1 (*2), fpd wdata wclock rdata rclock digital data separator with write precompensation nrdata, nwdata vcc2 powered circuitry vcc1 powered circuitry txd1, nrts1, ndtr1 rxd1, ncts1, ndsr1, ndcd1 16c550 compatible serial port 1 txd2(*1), nrts2(*1), ndtr2 (*1) rxd2(*1), ncts2(*1), ndsr2(*1), ndcd2(*1), nri2 (*1) 16c550 compatible serial port 2 with infrared irtx irrx nri1 sirq sirq/psb interface host cpu interface nior niow aen sa[0:15] sd[0:7] drq[0:1] ndack[0:1] irq4 irq[1,6-8,12] (*2) irq[3] (*3), nsmi (*2) tc iochrdy nnows nmemrd nmemwr nromcs system reset nreset_out configuration registers pd[0:7] busy, slct, pe, nerror, nack nstb, nslctin, ninit, nalf multi-mode parallel port / fdc mux fad[0:7] fa[8:17], nfrd, nfwr, fale 28f020 (2mbit) flash interface ksi[0:7] ks0[0:13] , ks0[14:15](*2) 16 x 8 matrix keyboard interface emclk, emdat, imclk, imdat kbclk, kbdat, ps2clk(*1), ps2dat(*1) ps/2 ports ab_data, ab_clk access bus pwm0 (*2), pwm1 (*2) pwm nbat_led, npwr_led, nfdd_led led driver general purpose i/o interface in in0 - 7 out0 - 11 gpio16 - 21 gpio0 - 15 i/o i/o out mailbox registers 256b external 8051 ram 8051 sub-block external control registers ring oscillator 8051 pll clock generator clocki (14.318 mhz) 24mhz_out rtc two 128b banks of cmos ram xtal1 xtal2 32khz_out xosel vcc0 agnd bank 1 bank 2 power management pwrgood nea mode control inputs vcc1 (2) vcc2 (5) gnd (9) control address data control address data control address data control address data vcc1_pwgd wdt 256b direct ram drq[2:3]*2 psbclk psbdat ndack[2:3]*1
smsc ds ? FDC37N958FR page 14 rev. 09/01/99 FDC37N958FR operating registers the address map, shown below in table 3, shows the set of operating registers and addresses for each of the logical blocks of the FDC37N958FR ultra i/o controller. the base addresses of the fdc, parallel, serial 1 and serial 2 ports can be moved via the configuration registers. host processor interface the host processor communicates with the FDC37N958FR through a series of read/write registers. the range of base i/o port addresses for these registers is shown in table 3. register access is accomplished through programmed i/o or dma transfers. all registers are 8 bits. most of the registers support zero wait-state access (nows). all host interface output buffers are capable of sinking a minimum of 12 ma. table 3 - FDC37N958FR operating register addresses logical device number logical device base i/o range (note3) fixed base offsets isa cycle type 0x00 fdc [0x100:0x0ff8] on 8 byte boundaries +0 : sra +1 : srb +2 : dor +3 : tsr +4 : msr/dsr +5 : fifo +7 : dir/ccr nows 0x03 parallel port [0x100:0x0ffc] on 4 byte boundaries (epp not supported) or [0x100:0x0ff8] on 8 byte boundaries (all modes supported, epp is only available when the base address is on an 8-byte boundary) +0 : data / ecpafifo +1 : status +2 : control +400h : cfifo / ecpdfifo tfifo / cnfga +401h : cnfgb +402h : ecr std. isa i/o
smsc ds ? FDC37N958FR page 15 rev. 09/01/99 logical device number logical device base i/o range (note3) fixed base offsets isa cycle type 0x04 serial port 1 [0x100:0x0ff8] on 8 byte boundaries +0 : rb/tb $ lsb div +1 : ier % msb div +2 : iir/fcr +3 : lcr +4 : mcr +5 : lsr +6 : msr +7 : scr nows 0x05 serial port 2 [0x100:0x0ff8] on 8 byte boundaries +0 : rb/tb $ lsb div +1 : ier % msb div +2 : iir/fcr +3 : lcr +4 : mcr +5 : lsr +6 : msr +7 : scr nows 0x62, 0x63 [0x100:0x0ff8] on 8 byte boundaries +0 : register block n, address 0 +1 : register block n, address 1 +2 : register block n, address 2 +3 : register block n, address 3 +4 : register block n, address 4 +5 : register block n, address 5 +6 : register block n, address 6 +7 : usrt master control reg. 0x06 rtc not relocatable fixed base address 0x70, 0x74 : address register 0x71, 0x76 : data register nows std. isa i/o
smsc ds ? FDC37N958FR page 16 rev. 09/01/99 logical device number logical device base i/o range (note3) fixed base offsets isa cycle type 0x07 kybd not relocatable fixed base address 0x60 : data register 0x64 : command/status reg. nows note 1: refer to the configuration register descriptions for setting the base address note 2: serial port 2 supports infrared. note 3: this chip uses all isa address bits to decode the base address of each of its logical devices.
smsc ds ? FDC37N958FR page 17 rev. 09/01/99 auto power management auto power management (apm) capabilities are provided for the following logical devices: floppy disk, uart 1, uart 2 and the parallel port. for each logical device, two types of power management are provided; direct powerdown and auto powerdown. system power management see the ?8051 system power management? section for details. fdc power management direct power management is controlled through global configuration register 22 (cr22). refer to cr22 in the configuration section for more information. auto power management is enabled through bit-0 of cr23. when set, this bit allows the fdc to enter powerdown when all of the following conditions have been met: 1. the motor enable pins of the fdc?s dor register are inactive (zero). 2. the FDC37N958FR must be idle; the msr register = 80h and the fdc?s interrupt = 0 (int may be high even if msr = 80h due to polling interrupts). 3. the head unload timer must have expired. 4. the auto powerdown timer (10msec) must have timed out. an internal timer is initiated as soon as the auto powerdown command is enabled. the FDC37N958FR is then powered down when all the conditions are met. disabling the auto powerdown mode cancels the timer and holds the fdc block out of auto powerdown. dsr from powerdown bit 6 of the fdc?s dsr register is another fdc powerdown bit. if dsr powerdown is used when the FDC37N958FR is in auto powerdown, the dsr powerdown will override the auto powerdown. however, when the FDC37N958FR is awakened from dsr powerdown, the auto powerdown will once again become effective. wake up from auto powerdown if the FDC37N958FR enters the powerdown state through the auto powerdown mode, then the FDC37N958FR can be awakened by reset or by appropriate access to certain registers. if a hardware or software reset is used then the FDC37N958FR will go through the normal reset sequence. if the access is through the selected registers, then the fdc resumes operation as though it was never in powerdown. besides activating the reset pin or one of the software reset bits in the dor or dsr registers, the following register accesses will wake up the FDC37N958FR: 1. enabling any one of the motor enable bits in the dor register (reading the dor does not awaken the FDC37N958FR). 2. a read from the msr register. 3. a read or write to the data register. once awake, the fdc will reinitiate the auto powerdown timer for 10 ms. the FDC37N958FR will powerdown again when all the powerdown conditions are satisfied.
smsc ds ? FDC37N958FR page 18 rev. 09/01/99 register behavior table 4 shows the at and ps/2 (including model 30) configuration registers available. it also shows the type of access permitted. in order to maintain software transparency, access to all the registers is maintained. as table 4 shows, two sets of registers are distinguished based on whether their access results in the FDC37N958FR remaining in powerdown state or exiting it. access to all other registers is possible without awakening the FDC37N958FR. these registers can be accessed during powerdown without changing the status of the FDC37N958FR. a read from these registers will reflect the true status as shown in the register description in the fdc section. writes to these registers will result in the FDC37N958FR retaining the data and subsequently reflecting it when the FDC37N958FR awakens. accessing the FDC37N958FR during powerdown may cause an increase in the power consumption by the FDC37N958FR. the FDC37N958FR will revert back to its low power mode when the access has been completed. pin behavior the FDC37N958FR is specifically designed for portable pc systems in which power conservation is a primary concern. this makes the behavior of the pins during powerdown very important. the pins which interface to the floppy disk drive are disabled so that no power will be drawn through the FDC37N958FR as a result of any voltage applied to the pin within the vcc2 power supply range. most of the pins which interface to the system are left active to monitor system accesses that may wake up the FDC37N958FR.
smsc ds ? FDC37N958FR page 19 rev. 09/01/99 system interface pins table 5 gives the state of the system interface pins in the powerdown state. pins unaffected by the powerdown are labeled "unchanged". input pins are "disabled" to prevent them from causing currents internal to the FDC37N958FR when they have indeterminate input values. table 4 - pc/at and ps/2 available registers base + address available registers access permitted pc/at ps/2 (model 30) access to these registers does not wake up the FDC37N958FR 00h ---- sra r 01h ---- srb r 02h dor (1) dor (1) r/w 03h --- --- --- 04h dsr (1) dsr (1) w 06h --- --- --- 07h dir dir r 07h ccr ccr w access to these registers wakes up the FDC37N958FR 04h msr msr r 05h data data r/w note 1: writing to the dor or dsr does not wake up the FDC37N958FR, however, writing any of the motor enable bits or doing a software reset (via dor or dsr reset bits) will wake up the FDC37N958FR.
smsc ds ? FDC37N958FR page 20 rev. 09/01/99 table 5 - state of system pins in fdc auto powerdown system pins state in auto powerdown input pins nior unchanged niow unchanged aen unchanged nmemrd unchanged nmemwr unchanged sa[15:0] unchanged sd[7:0] unchanged nnows unchanged(hi-z) ndackx unchanged tc unchanged nromcs unchanged output pins reset_out unchanged irqx unchanged(low) db[0:7] unchanged drqx unchanged(low) iochrdy unchange(n/a) fdd interface pins all pins in the fdd interface which can be connected directly to the floppy disk drive itself are either disabled or tristated. pins used for local logic control or part programming are unaffected. table 6 depicts the state of the floppy disk drive interface pins in the powerdown state. fdd power down pin (fpd) behavior the fpd pin can be used to automatically shut off power to the floppy disk drive when it is not required. the fpd pin is an active high output signal which is driven based on the states of the fdc. whenever the fdc shutdown bit is set (see fdd mode register, bit-5 in the configuration register section) the fpd pin goes high. if the fdc shutdown bit is not set then the fpd pin will go high whenever the fdc bit (see bit 0 of the power mgmt register in the configuration section) is set and the fdc has entered an auto powerdown state as described above. if neither the fdc shutdown bit nor the fdc bit are set then the fpd pin goes active ?high? when the power- down bit is set (see bit 6 of the data rate select register [dsr]) and ?low? when the powerdown bit is cleared. refer to table 6a.
smsc ds ? FDC37N958FR page 21 rev. 09/01/99 table 6 - state of floppy disk drive interface pins in fdc powerdown fdd pins state in fdc auto powerdown input pins nrdata input nwprot input ntrk0 input nindex input ndskchg input output pins nmtr[1:0] tristated nds[1:0] tristated ndir active nstep active nwdata tristated wgate tristated nhdsel active drvden[1:0] active fpd active table 6a - fpd pin behavior power down bit, dsr, bit-6 fdc bit, gcr23 bit-0 auto power down fdc shutdown bit, fdd mode register fpd pin state 00 00 10 01 x 1 0 1 (note) xx 11 note: the fpd pin will go active when the fdc auto powers down. refer to the fdc auto power management section for more details.
smsc ds ? FDC37N958FR page 22 rev. 09/01/99 uart power management direct power management is controlled by cr22. refer to cr22 in the configuration section for more information. auto power management is enabled by cr23 bit 4 and bit 5. when set, these bits allow the following auto power management operations: 1. the transmitter enters auto powerdown when the transmit buffer and shift register are empty. 2. the receiver enters powerdown when the following conditions are all met: a. receive fifo is empty b. the receiver is waiting for a start bit. note: while in powerdown the ring indicator interrupt is still valid. exit auto powerdown the transmitter exits powerdown on a write to the transmit buffer. the receiver exits auto powerdown when rxd changes state. parallel port power management direct power management is controlled by cr22. refer to cr22 in the configuration section for more information. auto power management is enabled by cr23 bit 3. when set, this bit allows the ecp or epp logical parallel port blocks to be placed into powerdown when not being used. the epp logic is in powerdown under any of the following conditions: 1. epp is not enabled in the configuration registers. 2. epp is not selected through ecr while in ecp mode. the ecp logic is in powerdown under any of the following conditions: 1. ecp is not enabled in the configuration registers. 2 spp, ps/2 parallel port or epp mode is selected through ecr while in ecp mode. exit auto powerdown the parallel port logic can change powerdown modes when the ecp mode is changed through the ecr register or when the parallel port mode is changed through the configuration registers.
smsc ds ? FDC37N958FR page 23 rev. 09/01/99 floppy disk controller the floppy disk controller (fdc) provides the interface between a host microprocessor and the floppy disk drives (fdd). the fdc integrates the functions of the formatter/controller, digital data separator, write precompensation and data rate selection logic for an ibm xt/at compatible fdc. the true cmos 765b core guarantees 100% ibm pc xt/at compatibility in addition to providing data overflow and underflow protection. the fdc is compatible to the 82077aa using smsc's proprietary fdc core. fdc internal registers the fdc contains eight internal registers which facilitate the interfacing between the host microprocessor and the disk drive. shows the addresses required to access these registers. registers other than the ones shown are not supported. table 7 - status, data and control registers fdc primary base i/o address offset r/w register 0 r status register a (sra) 1 r status register b (srb) 2 r/w digital output register (dor) 3 r/w tape drive register (tdr) 4 r main status register (msr) 4 w data rate select register (dsr) 5 r/w data (fifo) 6 reserved 7 r digital input register (dir) 7 w configuration control register (ccr)
smsc ds ? FDC37N958FR page 24 rev. 09/01/99 status register a (sra) fdc i/o base address + 0x00 (read only) this register is read-only and monitors the state of the fdc interrupt pin and several disk interface pins in ps/2 and model 30 modes. the sra can be accessed at any time when in ps/2 mode. in the pc/at mode the data bus pins d0 - d7 are held in a high impedance state for a read of sra. sra - ps/2 mode 7 6543210 int pending ndrv2 step ntrk0 hdsel nindx nwp dir reset cond. 0 n/a 0 n/a 0 n/a n/a 0 bit 0 direction active high status indicating the direction of head movement. a logic "1" indicates inward direction; a logic "0" indicates outward direction. bit 1 nwrite protect active low status of the write protect disk interface input. a logic "0" indicates that the disk is write protected. bit 2 nindex active low status of the index disk interface input. bit 3 head select active high status of the hdsel disk interface input. a logic "1" selects side 1 and a logic "0" selects side 0. bit 4 ntrack 0 active low status of the trk0 disk interface input. bit 5 step active high status of the step output disk interface output pin. bit 6 ndrv2 active low status of the drv2 disk interface input pin, indicating that a second drive has been installed. bit 7 interrupt pending active high bit indicating the state of the floppy disk interrupt output.
smsc ds ? FDC37N958FR page 25 rev. 09/01/99 sra - ps/2 model 30 mode 7 654 3 210 int pending drq step f/f trk0 nhdsel indx wp ndir reset cond. 0 0 0 n/a 1 n/a n/a 1 bit 0 ndirection active low status indicating the direction of head movement. a logic "0" indicates inward direction; a logic "1" indicates outward direction. bit 1 write protect active high status of the write protect disk interface input. a logic "1" indicates that the disk is write protected. bit 2 index active high status of the index disk interface input. bit 3 nhead select active low status of the hdsel disk interface input. a logic "0" selects side 1 and a logic "1" selects side 0. bit 4 track 0 active high status of the trk0 disk interface input. bit 5 step active high status of the latched step disk interface output pin. this bit is latched with the step output going active, and is cleared with a read from the dir register, or with a hardware or software reset. bit 6 dma request active high status of the fdc?s drq output pin. bit 7 interrupt pending active high bit indicating the state of the floppy disk interrupt output.
smsc ds ? FDC37N958FR page 26 rev. 09/01/99 status register b (srb) floppy disk controller base address + 0x01 (read only) this register is read-only and monitors the state of several disk interface pins in ps/2 and model 30 modes. the srb can be accessed at any time when in ps/2 mode. in the pc/at mode the data bus pins d0 - d7 are held in a high impedance state for a read of srb. srb - ps/2 mode 765 4 3 2 10 1 1 drive sel0 wdata toggle rdata toggle wgate mot en1 mot en0 reset cond. 110 0 0 0 00 bit 0 motor enable 0 active high status of the mtr0 disk interface output pin. this bit is low after a hardware reset and unaffected by a software reset. bit 1 motor enable 1 active high status of the mtr1 disk interface output pin. this bit is low after a hardware reset and unaffected by a software reset. bit 2 write gate active high status of the wgate disk interface output. bit 3 read data toggle every inactive edge of the rdata input causes this bit to change state. bit 4 write data toggle every inactive edge of the wdata output causes this bit to change state. bit 5 drive select 0 reflects the status of the drive select 0 bit of the dor (address 3f2 bit 0). this bit is cleared after a hardware reset and it is unaffected by a software reset. bit 6 reserved always read as a logic "1". bit 7 reserved always read as a logic "1".
smsc ds ? FDC37N958FR page 27 rev. 09/01/99 srb - ps/2 model 30 mode 765 4 3 2 10 ndrv2 nds1 nds0 wdata f/f rdata f/f wgate f/f nds3 nds2 reset cond. n/a 1 1 0 0 0 1 1 bit 0 ndrive select 2 active low status of the ds2 disk interface output. bit 1 ndrive select 3 active low status of the ds3 disk interface output. bit 2 write gate active high status of the latched wgate output signal. this bit is latched by the active going edge of wgate and is cleared by the read of the dir register. bit 3 read data active high status of the latched rdata input signal. this bit is latched by the inactive going edge of rdata and is cleared by the read of the dir register. bit 4 write data active high status of the latched wdata output signal. this bit is latched by the inactive going edge of wdata and is cleared by the read of the dir register. this bit is not gated with wgate. bit 5 ndrive select 0 active low status of the ds0 disk interface output. bit 6 ndrive select 1 active low status of the ds1 disk interface output. bit 7 ndrv2 active low status of the drv2 disk interface input.
smsc ds ? FDC37N958FR page 28 rev. 09/01/99 digital output register (dor) fdc i/o base address + 0x02 (read/write) the dor controls the drive select and motor enables of the disk interface outputs. it also contains the enable for the dma logic and a software reset bit. the contents of the dor are unaffected by a software reset. the dor can be written to at any time. 7654 3 210 mot en3 mot en2 mot en1 mot en0 dmaen nrese t drive sel1 drive sel0 reset cond. 0000 0 000 bit 0 and 1 drive select these two bits are binary encoded for the two drive selects output pins nds0 and nds1, thereby allowing only one drive to be selected at one time. bit 2 nreset a logic "0" written to this bit resets the fdc. this reset will remain active until a logic "1" is written to this bit. this software reset does not affect the dsr and ccr registers, nor does it affect the other bits of the dor register. the minimum reset duration required is 100ns, therefore toggling this bit by consecutive writes to this register is a valid method of issuing a software reset. bit 3 dmaen pc/at and model 30 mode: writing this bit to logic "1" will enable the fdc?s ndack and tc inputs and enable the fdc?s drq and interrupt outputs. this bit being a logic "0" will disable the fdc?s ndack and tc inputs, and hold the fdc?s drq and interrupt outputs in a high impedance state. this bit is a logic "0" after a reset. ps/2 mode: in this mode the tc and the fdc?s drq, ndack, and interrupt pins are always enabled. during a reset, the drq, ndack, tc, and interrupt pins will remain enabled, but this bit will be cleared to a logic "0". bit 4 motor enable 0 this bit controls the nmtr0 disk interface output. a logic "1" in this bit will cause the output pin to assert. bit 5 motor enable 1 this bit controls the nmtr1 disk interface output. a logic "1" in this bit will cause the output pin to assert. bit 6 motor enable 2 this bit controls the nmtr2 disk interface output. a logic "1" in this bit will cause the output pin to assert. bit 7 motor enable 3 this bit controls the nmtr3 disk interface output. a logic "1" in this bit will cause the output pin to assert.
smsc ds ? FDC37N958FR page 29 rev. 09/01/99 table 8 - drive activation values drive dor value 0 1 1ch 2dh table 9 - internal 2 drive decode - normal digital output register drive select outputs (active low) motor on outputs (active low) bit 7 bit 6 bit 5 bit 4 bit1 bit 0 nds1 nds0 nmtr1 nmtr0 x x x 1 0 0 1 0 nbit 5 nbit 4 x x 1 x 0 1 0 1 nbit 5 nbit 4 x 1 x x 1 0 1 1 nbit 5 nbit 4 1 x x x 1 1 1 1 nbit 5 nbit 4 0000xx 1 1 nbit 5 nbit 4 table 10 - internal 2 drive decode - drives 0 and 1 swapped digital output register drive select outputs (active low) motor on outputs (active low) bit 7 bit 6 bit 5 bit 4 bit1 bit 0 nds1 nds0 nmtr1 nmtr0 x x x 1 0 0 0 1 nbit 4 nbit 5 x x 1 x 0 1 1 0 nbit 4 nbit 5 x 1 x x 1 0 1 1 nbit 4 nbit 5 1xxx1 1 1 1 nbit 4 nbit 5 0000xx 1 1 nbit 4 nbit 5
smsc ds ? FDC37N958FR page 30 rev. 09/01/99 tape drive register (tdr) fdc i/o base address + 0x03 (read/write) this register is included for 82077 software compatability. the robust digital data separator used in the fdc does not require its characteristics modified for tape support. the contents of this register are not used internal to the device. the tdr is unaffected by a software reset. normal floppy mode normal mode. the tdr register contains only bits 0 and 1. when this register is read, bits 2 - 7 are a high impedance. db7 db6 db5 db4 db3 db2 db1 db0 reg 3f3 tri-state tri-state tri-state tri-state tri-state tri-state tape sel 1 tape sel 0 table 11 - tape select bits tape sel1 tape sel2 drive selected 0 0 none 011 102 113 enhanced floppy mode 2 (os2) the tdr register for enhanced floppy mode 2 operation. db7 db6 db5 db4 db3 db2 db1 db0 reg 3f3 media id1 media id0 drive type id floppy boot drive tape sel1 tape sel0 for this mode, mid[1:0] pins are gated into bits 6 and 7 of the tdr register. these two bits are not affected by a hard or soft reset. bit 7 media id 1 (read only) (pin 20) (see table 12 - media id1) bit 6 media id 0 (read only) (pin 19) (see table 13)
smsc ds ? FDC37N958FR page 31 rev. 09/01/99 bits 5 and 4 drive type id these bits reflect two of the bits of l0-crf1 (logical device 0 - configuration register 0xf1). which two bits these are depends on the last drive selected in the digital output register. (see table 14) table 12 - media id 1 input media id1 bit 7 pin 19 l0-crf1-b5 = 0 l0-crf1-b5 = 1 00 1 11 0 note: l0-crf1-b5 = logical device 0, configuration register f1, bit 5 bits 3 and 2 floppy boot drive these bits reflect two of the bits of l0-crf1. bit 3 = l0-crf1-b7. bit 2 = l0-crf1-b6. bit 1 and 0 - tape drive select (read/write) same as in normal and enhanced floppy mode 2. table 13 - media id 0 input media id0 bit 6 pin 20 crf1-b4 = 0 crf1-b4 = 1 001 110 table 14 - drive type id digital output register tdr register - drive type id bit 1 bit 0 bit 5 bit 4 0 0 l0-crf2 - b1 l0-crf2 - b0 0 1 l0-crf2 - b3 l0-crf2 - b2 1 0 l0-crf2 - b5 l0-crf2 - b4 1 1 l0-crf2 - b7 l0-crf2 - b6 note: l0-crf2-bx = logical device 0, configuration register f2, bit x.
smsc ds ? FDC37N958FR page 32 rev. 09/01/99 data rate select register (dsr) fdc i/o base address + 0x04 (write only) this register is write only. it is used to program the data rate, amount of write precompensation, power down status, and software reset. the data rate is programmed using the configuration control register (ccr) not the dsr, for pc/at and ps/2 model 30 and microchannel applications. other applications can set the data rate in the dsr. the data rate of the floppy controller is the most recent write of either the dsr or ccr. the dsr is unaffected by a software reset. a hardware reset will set the dsr to 02h, which corresponds to the default precompensation setting and 250 kbps. 7654 3 210 s/w reset power down 0pre- comp2 pre- comp1 pre- comp0 drate sel1 drate sel0 reset cond. 0000 0 010 bits 0 - 1 data rate select these bits control the data rate of the floppy controller. see table 16 for the settings corresponding to the individual data rates. the data rate select bits are unaffected by a software reset and are set to 250 kbps after a hardware reset. bits 2 - 4 precompensation select these three bits select the value of write precompensation that will be applied to the wdata output signal. table 15 shows the precompensation values for the combination of these bits settings. track 0 is the default starting track number to start precompensation. this starting track number can be changed by the configure command. bit 5 undefined should be written as a logic "0". bit 6 low power a logic "1" written to this bit will put the floppy controller into manual low power mode. the floppy controller clock and data separator circuits will be turned off. the controller will come out of manual low power mode after a software reset or access to the data register or main status register. bit 7 software reset this active high bit has the same function as the dor reset (dor bit 2) except that this bit is self clearing.
smsc ds ? FDC37N958FR page 33 rev. 09/01/99 table 15 - precompensation delays precomp 432 precompensation delay (nsec) <2mbps 2mbps 111 001 010 011 100 101 110 000 0.00 41.67 83.34 125.00 166.67 208.33 250.00 default 0 20.8 41.7 62.5 83.3 104.2 125 default default: see table 17 table 16 - data rates drive rate data rate data rate densel drate(1) drt1 drt0 sel1 sel0 mfm fm 1 0 0 0 1 1 1meg --- 1 1 1 0 0 0 0 500 250 1 0 0 0 0 0 1 300 150 0 0 1 0 0 1 0 250 125 0 1 0 0 1 1 1 1meg --- 1 1 1 0 1 0 0 500 250 1 0 0 0 1 0 1 500 250 0 0 1 0 1 1 0 250 125 0 1 0 1 0 1 1 1meg --- 1 1 1 1 0 0 0 500 250 1 0 0 1 0 0 1 2meg --- 0 0 1 1 0 1 0 250 125 0 1 0 drive rate table (recommended) 00 = 360k, 1.2m, 720k, 1.44m and 2.88m vertical format 01 = 3-mode drive 10 = 2 meg tape note 1: the drate and densel values are mapped onto the driveden pins.
smsc ds ? FDC37N958FR page 34 rev. 09/01/99 table 17 - drvden mapping dt1 dt0 drvden1 (1) drvden0 (1) drive type 0 0 drate0 densel 4/2/1 mb 3.5" 2/1 mb 5.25" fdds 2/1.6/1 mb 3.5" (3-mode) 1 0 drate0 drate1 0 1 drate0 ndensel ps/2 1 1 drate1 drate0 table 18 - default precompensation delays data rate precompensation delays 2 mbps 1 mbps 500 kbps 300 kbps 250 kbps 20.8 ns 41.67 ns 125 ns 125 ns 125 ns the 2 mbps data rate is only available if v cc = 5v.
smsc ds ? FDC37N958FR page 35 rev. 09/01/99 main status register fdc i/o base address + 0x04 (read only) the main status register is a read-only register and indicates the status of the disk controller. the main status register can be read at any time. the msr indicates when the disk controller is ready to receive data via the data register. it should be read before each byte transferring to or from the data register except in dma mode. no delay is required when reading the msr after a data transfer. 76543210 rqm dio non dma cmd busy drv3 busy drv2 busy drv1 busy drv0 busy bit 0 - 3 drvx busy these bits are set to 1s when a drive is in the seek portion of a command, including implied and overlapped seeks and recalibrates. bit 4 command busy this bit is set to a ?1? when a command is in progress. this bit will go active after the command byte has been accepted and goes inactive at the end of the results phase. if there is no result phase (seek, recalibrate commands), this bit is returned to a ?0? after the last command byte. bit 5 non-dma this mode is selected in the specify command and will be set to a ?1? during the execution phase of a command. this is for polled data transfers and helps differentiate between the data transfer phase and the reading of result bytes. bit 6 dio indicates the direction of a data transfer once a rqm is set. a ?1? indicates a read and a ?0? indicates a write is required. bit 7 rqm indicates that the host can transfer data if set to a ?1?. no access is permitted if set to a ?0?. data register (fifo) fdc i/o base address + 0x05 (read/write) all command parameter information, disk data and result status are transferred between the host processor and the fdc through the data register. data transfers are governed by the rqm and dio bits in the main status register. the data register defaults to fifo disabled mode after any form of reset. this maintains pc/at hardware compatibility. the default values can be changed through the configure command (enable full fifo operation with threshold control). the advantage of the fifo is that it allows the system a larger dma latency without causing a disk error. table 19 gives several examples of the delays with a fifo. the data is based upon the following formula: threshold # x [8/data rate] - 1.5ms = delay at the start of a command, the fifo action is always disabled and command parameters must be sent based upon the rqm and dio bit settings. as the command execution phase is entered, the fifo is cleared of any data to ensure that invalid data is not transferred. an overrun or underrun will terminate the current command and the transfer of data. disk writes will complete the current sector by generating a 00 pattern and valid crc. reads require the host to remove the remaining data so that the result phase may be entered.
smsc ds ? FDC37N958FR page 36 rev. 09/01/99 table 19 - fifo service delay table fifo threshold examples maximum delay to servicing at 2 mbps* data rate 1 byte 2 bytes 8 bytes 15 bytes 1 x 4 ms - 1.5 ms = 2.5 ms 2 x 4 ms - 1.5 ms = 6.5 ms 8 x 4 ms - 1.5 ms = 30.5 ms 15 x 4 ms - 1.5 ms = 58.5 ms fifo threshold examples maximum delay to servicing at 1 mbps data rate 1 byte 2 bytes 8 bytes 15 bytes 1 x 8 ms - 1.5 ms = 6.5 ms 2 x 8 ms - 1.5 ms = 14.5 ms 8 x 8 ms - 1.5 ms = 62.5 ms 15 x 8 ms - 1.5 ms = 118.5 ms fifo threshold examples maximum delay to servicing at 500 kbps data rate 1 byte 2 bytes 8 bytes 15 bytes 1 x 16 ms - 1.5 ms = 14.5 ms 2 x 16 ms - 1.5 ms = 30.5 ms 8 x 16 ms - 1.5 ms = 126.5 ms 15 x 16 ms - 1.5 ms = 238.5 ms the 2 mbps data rate is only available if v cc = 5v nominal.
smsc ds ? FDC37N958FR page 37 rev. 09/01/99 digital input register (dir) fdc i/o base address + 0x07 (read only) this register is read-only in all modes. dir - pc-at mode 76543210 dsk chg reset cond. n/a n/a n/a n/a n/a n/a n/a n/a bit 0 - 6 undefined the data bus outputs d0 - 6 will remain in a high impedance state during a read of this register. bit 7 dskchg this bit monitors the pin of the same name and reflects the opposite value seen on the disk cable. dir - ps/2 mode 76543210 dsk chg 1111drate sel1 drate sel0 nhigh dens reset cond. n/a n/a n/a n/a n/a n/a n/a 1 bit 0 nhigh dens this bit is low whenever the 500 kbps or 1 mbps data rates are selected, and high when 250 kbps and 300 kbps are selected. bits 1 - 2 data rate select these bits control the data rate of the floppy controller. see table 16 for the settings corresponding to the individual data rates. the data rate select bits are unaffected by a software reset, and are set to 250 kbps after a hardware reset. bits 3 - 6 undefined always read as a logic "1" bit 7 dskchg this bit monitors the pin of the same name and reflects the opposite value seen on the disk cable.
smsc ds ? FDC37N958FR page 38 rev. 09/01/99 dir - model 30 mode 76543 2 10 dsk chg 0 0 0 dmaen noprec drate sel1 drate sel0 reset cond. n/a0000 0 10 bits 0 and 1 data rate select these bits control the data rate of the floppy controller. see table 16 for the settings corresponding to the individual data rates. the data rate select bits are unaffected by a software reset and are set to 250 kbps after a hardware reset. bit 2 noprec this bit reflects the value of noprec bit set in the ccr register. bit 3 dmaen this bit reflects the value of dmaen bit set in the dor register bit 3. bits 4 - 6 undefined always read as a logic "0" bit 7 dskchg this bit monitors the pin of the same name and reflects the opposite value seen on the pin.
smsc ds ? FDC37N958FR page 39 rev. 09/01/99 configuration control register (ccr) fdc i/o base address + 0x07 (write only) pc/at and ps/2 mode 76543210 drate sel1 drate sel0 reset cond. n/a n/a n/a n/a n/a n/a 1 0 bit 0 and 1 data rate select 0 and 1 these bits determine the data rate of the floppy controller. see table 16 for the appropriate values. bit 2 - 7 reserved should be set to a logical "0" ccr - ps/2 model 30 mode 76543 2 10 noprec drate sel1 drate sel0 reset cond. n/a n/a n/a n/a n/a n/a 1 0 bit 0 and 1 data rate select 0 and 1 these bits determine the data rate of the floppy controller. see table 16 for the appropriate values. bit 2 no precompensation this bit can be set by software, but it has no functionality. it can be read by bit 2 of the dsr when in model 30 register mode. unaffected by software reset. bit 3 - 7 reserved should be set to a logical "0" table 16 shows the state of the densel pin. the densel pin is set high after a hardware reset and is unaffected by the dor and the dsr resets.
smsc ds ? FDC37N958FR page 40 rev. 09/01/99 status register encoding during the result phase of certain commands, the data register contains data bytes that give the status of the command just executed. table 20 - status register 0 bit no. symbol name description 7,6 ic interrupt code 00 - normal termination of command. the specified command was properly executed and completed without error. 01 - abnormal termination of command. command execution was started, but was not successfully completed. 10 - invalid command. the requested command could not be executed. 11 - abnormal termination caused by polling. 5 se seek end the fdc completed a seek, relative seek or recalibrate command (used during a sense interrupt command). 4 ec equipment check the trk0 pin failed to become a "1" after: 1. step pulses in the recalibrate command. 2. the relative seek command caused the fdc to step outward beyond track 0. 3 unused. this bit is always "0". 2 h head address the current head address. 1,0 ds1,0 drive select the current selected drive.
smsc ds ? FDC37N958FR page 41 rev. 09/01/99 table 21 - status register 1 bit no. symbol name description 7 en end of cylinder the fdc tried to access a sector beyond the final sector of the track (255d). will be set if tc is not issued after read or write data command. 6 unused. this bit is always "0". 5 de data error the fdc detected a crc error in either the id field or the data field of a sector. 4 or overrun/ underrun becomes set if the fdc does not receive cpu or dma service within the required time interval, resulting in data overrun or underrun. 3 unused. this bit is always "0". 2 nd no data any one of the following: 1. read data, read deleted data command - the fdc did not find the specified sector. 2. read id command - the fdc cannot read the id field without an error. 3. read a track command - the fdc cannot find the proper sector sequence. 1 nw not writable wp pin became a "1" while the fdc is executing a write data, write deleted data, or format a track command. 0 ma missing address mark any one of the following: 1. the fdc did not detect an id address mark at the specified track after encountering the index pulse from the idx pin twice. 2. the fdc cannot detect a data address mark or a deleted data address mark on the specified track.
smsc ds ? FDC37N958FR page 42 rev. 09/01/99 table 22 - status register 2 bit no. symbol name description 7 unused. this bit is always "0". 6 cm control mark any one of the following: 1. read data command - the fdc encountered a deleted data address mark. 2. read deleted data command - the fdc encountered a data address mark. 5 dd data error in data field the fdc detected a crc error in the data field. 4 wc wrong cylinder the track address from the sector id field is different from the track address maintained inside the fdc. 3 unused. this bit is always "0". 2 unused. this bit is always "0". 1 bc bad cylinder the track address from the sector id field is different from the track address maintained inside the fdc and is equal to ff hex, which indicates a bad track with a hard error according to the ibm soft-sectored format. 0 md missing data address mark the fdc cannot detect a data address mark or a deleted data address mark. table 23 - status register 3 bit no. symbol name description 7 unused. this bit is always "0". 6 wp write protected indicates the status of the wp pin. 5 unused. this bit is always "1". 4 t0 track 0 indicates the status of the trk0 pin. 3 unused. this bit is always "1". 2 hd head address indicates the status of the hdsel pin. 1,0 ds1,0 drive select indicates the status of the nds1, nds0 pins. fdc reset there are three sources of system reset on the fdc: the nreset_out bit of the 8051?s output enable register (which controls the reset_out/nreset_out pins of the FDC37N958FR); a reset generated via a bit in the dor; and a reset generated via a bit in the dsr. at vcc2 power on, a vcc2 power on reset initializes the fdc. all resets take the fdc out of the power down state. all operations are terminated upon a reset, and the floppy disk controller enters an idle state. a reset while a disk write is in progress will corrupt the data and crc. on exiting the reset state, various internal registers are cleared, including the configure command information, and the floppy disk controller waits for a new command. drive polling will start unless disabled by a new configure command.
smsc ds ? FDC37N958FR page 43 rev. 09/01/99 reset_out pin (hardware reset) the reset_out pin is a global reset and clears all registers except those programmed by the specify command. the dor reset bit is enabled and must be cleared by the host to exit the reset state. dor reset vs. dsr reset (software reset) these two resets are functionally the same. both will reset the fdc core, which affects drive status information and the fifo circuits. the dsr reset clears itself automatically while the dor reset requires the host to manually clear it. dor reset has precedence over the dsr reset. the dor reset is set automatically upon a reset_out pin reset. the user must manually clear this reset bit in the dor to exit the reset state. fdc modes of operation the fdc has three modes of operation, pc/at mode, ps/2 mode and model 30 mode. these are determined by the state of ident and mfm, bits[3] and [2] respectively of l0-crf0. pc/at mode - (ident high, mfm a "don't care") the pc/at register set is enabled, the dma enable bit of the dor becomes valid (the fdc?s irq and drq can be hi-z), and tc and densel become active high signals. ps/2 mode - (ident low, mfm high) this mode supports the ps/2 models 50/60/80 configuration and register set. the dma bit of the dor becomes a "don't care", (the fdc?s irq and drq are always valid), tc and densel become active low. model 30 mode - (ident low, mfm low) this mode supports ps/2 model 30 configuration and register set. the dma enable bit of the dor becomes valid (the fdc?s irq and drq can be hi-z), tc is active high and densel is active low. dma transfers dma transfers are enabled with the specify command and are initiated by the fdc by activating its drq pin during a data transfer command. the fifo is enabled directly by asserting ndack and addresses need not be valid. note that if the dma controller (i.e. 8237a) is programmed to function in verify mode, a pseudo read is performed by the fdc based only on ndack. this mode is only available when the fdc has been configured into byte mode (fifo disabled) and is programmed to do a read. with the fifo enabled, the fdc can perform the above operation by using the new verify command; no dma operation is needed. controller phases for simplicity, command handling in the fdc can be divided into three phases: command, execution, and result. each phase is described in the following sections. command phase after a reset, the fdc enters the command phase and is ready to accept a command from the host. for each of the commands, a defined set of command code bytes and parameter bytes has to be written to the fdc before the command phase is complete. (please refer to table 24 for the command set descriptions). these bytes of data must be transferred in the order prescribed. before writing to the fdc, the host must examine the rqm and dio bits of the main status register. rqm and dio must be equal to "1" and "0" respectively before command bytes may be written. rqm is set false by the fdc after each write cycle until the received byte is processed. the fdc asserts rqm again to request each parameter byte of the command unless an illegal command condition is detected. after the last parameter byte is received, rqm remains "0" and the fdc automatically enters the next phase as defined by the command definition. the fifo is disabled during the command phase to provide for the proper handling of the "invalid command" condition.
smsc ds ? FDC37N958FR page 44 rev. 09/01/99 execution phase all data transfers to or from the fdc occur during the execution phase, which can proceed in dma or non-dma mode as indicated in the specify command. after a reset, the fifo is disabled. each data byte is transferred by an fdc irq or drq depending on the dma mode. the configure command can enable the fifo and set the fifo threshold value. the following paragraphs detail the operation of the fifo flow control. in these descriptions, is defined as the number of bytes available to the fdc when service is requested from the host and ranges from 1 to 16. the parameter fifothr, which the user programs, is one less and ranges from 0 to 15. a low threshold value (i.e. 2) results in longer periods of time between service requests, but requires faster servicing of the request for both read and write cases. the host reads (writes) from (to) the fifo until empty (full), then the transfer request goes inactive. the host must be very responsive to the service request. this is the desired case for use with a "fast" system. a high value of threshold (i.e. 12) is used with a "sluggish" system by affording a long latency period after a service request, but results in more frequent service requests. non-dma mode - transfers from the fifo to the host the fdc?s irq pin and rqm bits in the main status register are activated when the fifo contains (16-) bytes or the last bytes of a full sector have been placed in the fifo. the fdc?s irq pin can be used for interrupt-driven systems, and rqm can be used for polled systems. the host must respond to the request by reading data from the fifo. this process is repeated until the last byte is transferred out of the fifo. the fdc will deactivate the fdc?s irq pin and rqm bit when the fifo becomes empty. non-dma mode - transfers from the host to the fifo the fdc?s irq pin and rqm bit in the main status register are activated upon entering the execution phase of data transfer commands. the host must respond to the request by writing data into the fifo. the fdc?s irq pin and rqm bit remain true until the fifo becomes full. they are set true again when the fifo has bytes remaining in the fifo. the fdc?s irq pin will also be deactivated if tc and ndack both go inactive. the fdc enters the result phase after the last byte is taken by the fdc from the fifo (i.e. fifo empty condition). dma mode - transfers from the fifo to the host the fdc activates the fdc?s drq pin when the fifo contains (16 - ) bytes, or the last byte of a full sector transfer has been placed in the fifo. the dma controller must respond to the request by reading data from the fifo. the fdc will deactivate the fdc?s drq pin when the fifo becomes empty. fdc?s drq goes inactive after ndack goes active for the last byte of a data transfer (or on the active edge of nior, on the last byte, if no edge is present on ndack). a data underrun may occur if the fdc?s drq is not removed in time to prevent an unwanted cycle. dma mode - transfers from the host to the fifo the fdc activates the fdc?s drq pin when entering the execution phase of the data transfer commands. the dma controller must respond by activating the ndack and niow pins placing data in the fifo. the fdc?s drq remains active until the fifo becomes full. the fdc?s drq is again set true when the fifo has bytes remaining in the fifo. the fdc will also deactivate the fdc?s drq pin when tc becomes true (qualified by ndack), indicating that no more data is required. the fdc?s drq goes inactive after ndack goes active for the last byte of a data transfer (or on the active edge of niow of the last byte, if no edge is present on ndack). a data overrun may occur if the fdc?s drq is not removed in time to prevent an unwanted cycle.
smsc ds ? FDC37N958FR page 45 rev. 09/01/99 data transfer termination the fdc supports terminal count explicitly through the tc pin and implicitly through the underrun/overrun and end-of-track (eot) functions. for full sector transfers, the eot parameter can define the last sector to be transferred in a single or multi-sector transfer. if the last sector to be transferred is a partial sector, the host can stop transferring the data in mid-sector, and the fdc will continue to complete the sector as if a hardware tc was received. the only difference between these implicit functions and tc is that they return "abnormal termination" result status. such status indications can be ignored if they were expected. note that when the host is sending data to the fifo of the fdc, the internal sector count will be complete when the fdc reads the last byte from its side of the fifo. there may be a delay in the removal of the transfer request signal of up to the time taken for the fdc to read the last 16 bytes from the fifo. the host must tolerate this delay. result phase the generation of the fdc?s irq determines the beginning of the result phase. for each of the commands, a defined set of result bytes has to be read from the fdc before the result phase is complete. these bytes of data must be read out for another command to start. rqm and dio must both equal "1" before the result bytes may be read. after all the result bytes have been read, the rqm and dio bits switch to "1" and "0" respectively, and the cb bit is cleared, indicating that the fdc is ready to accept the next command.
smsc ds ? FDC37N958FR page 46 rev. 09/01/99 command set/descriptions commands can be written whenever the fdc is in the command phase. each command has a unique set of needed parameters and status results. the fdc checks to see that the first byte is a valid command and, if valid, proceeds with the command. if it is invalid, an interrupt is issued. the user sends a sense interrupt status command which returns an invalid command error. refer to table 24 for explanations of the various symbols used. table 25 lists the required parameters and the results associated with each command that the fdc is capable of performing.
smsc ds ? FDC37N958FR page 47 rev. 09/01/99 ds1 ds0 drive 0 0 1 1 0 1 0 1 drive 0 drive 1 drive 2 drive 3 table 24 - description of the fdc command symbols symbol name description c cylinder address the currently selected address; 0 to 255. d data pattern the pattern to be written in each sector data field during formatting. d0, d1, d2, d3 drive select 0-3 designates which drives are perpendicular drives on the perpendicular mode command. a "1" indicates a perpendicular drive. dir direction control if this bit is 0, then the head will step out from the spindle during a relative seek. if set to a 1, the head will step in toward the spindle. ds0, ds1 disk drive select dtl special sector size by setting n to zero (00), dtl may be used to control the number of bytes transferred in disk read/write commands. the sector size (n = 0) is set to 128. if the actual sector (on the diskette) is larger than dtl, the remainder of the actual sector is read but is not passed to the host during read commands; during write commands, the remainder of the actual sector is written with all zero bytes. the crc check code is calculated with the actual sector. when n is not zero, dtl has no meaning and should be set to ff hex. ec enable count when this bit is "1" the "dtl" parameter of the verify command becomes sc (number of sectors per track). efifo enable fifo this active low bit when a 0, enables the fifo. a "1" disables the fifo (default). eis enable implied seek when set, a seek operation will be performed before executing any read or write command that requires the c parameter in the command phase. a "0" disables the implied seek. eot end of track the final sector number of the current track. gap alters gap 2 length when using perpendicular mode. gpl gap length the gap 3 size. (gap 3 is the space between sectors excluding the vco synchronization field). h/hds head address selected head: 0 or 1 (disk side 0 or 1) as encoded in the sector id field. hlt head load time the time interval that the fdc waits after loading the head and before initializing a read or write operation. refer to the specify command for actual delays. hut head unload time the time interval from the end of the execution phase (of a read or write command) until the head is unloaded. refer to the specify command for actual delays. lock lock defines whether efifo, fifothr, and pretrk parameters of the configure command can be reset to their default values by a "software reset". (a reset caused by
smsc ds ? FDC37N958FR page 48 rev. 09/01/99 symbol name description writing to the appropriate bits of either tha dsr or dor) mfm mfm/fm mode selector a one selects the double density (mfm) mode. a zero selects single density (fm) mode. mt multi-track selector when set, this flag selects the multi-track operating mode. in this mode, the fdc treats a complete cylinder under head 0 and 1 as a single track. the fdc operates as this expanded track started at the first sector under head 0 and ended at the last sector under head 1. with this flag set, a multitrack read or write operation will automatically continue to the first sector under head 1 when the fdc finishes operating on the last sector under head 0. n sector size code this specifies the number of bytes in a sector. if this parameter is "00", then the sector size is 128 bytes. the number of bytes transferred is determined by the dtl parameter. otherwise the sector size is (2 raised to the "n'th" power) times 128. all values up to "07" hex are allowable. "07"h would equal a sector size of 16k. it is the user's responsibility to not select combinations that are not possible with the drive. n sector size 00 128 bytes 01 256 bytes 02 512 bytes 03 1024 bytes ... ... 07 16 kbytes ncn new cylinder number the desired cylinder number. nd non-dma mode flag when set to 1, indicates that the fdc is to operate in the non- dma mode. in this mode, the host is interrupted for each data transfer. when set to 0, the fdc operates in dma mode, interfacing to a dma controller by means of the drq and ndack signals. ow overwrite the bits d0-d3 of the perpendicular mode command can only be modified if ow is set to 1. ow id defined in the lock command. pcn present cylinder number the current position of the head at the completion of sense interrupt status command. poll polling disable when set, the internal polling routine is disabled. when clear, polling is enabled. pretrk precompensation start track number programmable from track 00 to ffh. r sector address the sector number to be read or written. in multi-sector transfers, this parameter specifies the sector number of the first sector to be read or written. rcn relative cylinder number relative cylinder offset from present cylinder as used by the relative seek command. sc number of sectors per track the number of sectors per track to be initialized by the format command. the number of sectors per track to be verified during
smsc ds ? FDC37N958FR page 49 rev. 09/01/99 symbol name description a verify command when ec is set. sk skip flag when set to 1, sectors containing a deleted data address mark will automatically be skipped during the execution of read data. if read deleted is executed, only sectors with a deleted address mark will be accessed. when set to "0", the sector is read or written the same as the read and write commands. srt step rate interval the time interval between step pulses issued by the fdc. programmable from 0.5 to 8 milliseconds in increments of 0.5 ms at the 1 mbit data rate. refer to the specify command for actual delays. st0 st1 st2 st3 status 0 status 1 status 2 status 3 registers within the fdc which store status information after a command has been executed. this status information is available to the host during the result phase after command execution. wgate write gate alters timing of we to allow for pre-erase loads in perpendicular drives.
smsc ds ? FDC37N958FR page 50 rev. 09/01/99 fdc instruction set table 25 - fdc instruction set read data phase r/w data bus remarks d7 d6 d5 d4 d3 d2 d1 d0 command w mt mfm sk 0 0 1 1 0 command codes w 0 0 0 0 0 hds ds1 ds0 w -------- c -------- sector id information prior to command execution. w -------- h -------- w -------- r -------- w -------- n -------- w ------- eot ------- w ------- gpl ------- w ------- dtl ------- execution data transfer between the fdd and system. result r ------- st0 ------- status information after com- mand execution. r ------- st1 ------- r ------- st2 ------- r -------- c -------- sector id information after command execution. r -------- h -------- r -------- r -------- r -------- n --------
smsc ds ? FDC37N958FR page 51 rev. 09/01/99 read deleted data data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w mt mfm sk 0 1 1 0 0 command codes w 0 0 0 0 0 hds ds1 ds0 w -------- c -------- sector id information prior to command execution. w -------- h -------- w -------- r -------- w -------- n -------- w ------- eot ------- w ------- gpl ------- w ------- dtl ------- execution data transfer between the fdd and system. result r ------- st0 ------- status information after com- mand execution. r ------- st1 ------- r ------- st2 ------- r -------- c -------- sector id information after command execution. r -------- h -------- r -------- r -------- r -------- n --------
smsc ds ? FDC37N958FR page 52 rev. 09/01/99 write data data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w mt mfm 0 0 0 1 0 1 command codes w 0 0 0 0 0 hds ds1 ds0 w -------- c -------- sector id information prior to command execution. w -------- h -------- w -------- r -------- w -------- n -------- w ------- eot ------- w ------- gpl ------- w ------- dtl ------- execution data transfer between the fdd and system. result r ------- st0 ------- status information after com- mand execution. r ------- st1 ------- r ------- st2 ------- r -------- c -------- sector id information after command execution. r -------- h -------- r -------- r -------- r -------- n --------
smsc ds ? FDC37N958FR page 53 rev. 09/01/99 write deleted data data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w mt mfm 0 0 1 0 0 1 command codes w 0 0 0 0 0 hds ds1 ds0 w -------- c -------- sector id information prior to command execution. w -------- h -------- w -------- r -------- w -------- n -------- w ------- eot ------- w ------- gpl ------- w ------- dtl ------- execution data transfer between the fdd and system. result r ------- st0 ------- status information after command execution. r ------- st1 ------- r ------- st2 ------- r -------- c -------- sector id information after command execution. r -------- h -------- r -------- r -------- r -------- n --------
smsc ds ? FDC37N958FR page 54 rev. 09/01/99 read a track data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 mfm 0 0 0 0 1 0 command codes w 0 0 0 0 0 hds ds1 ds0 w -------- c -------- sector id information prior to command execution. w -------- h -------- w -------- r -------- w -------- n -------- w ------- eot ------- w ------- gpl ------- w ------- dtl ------- execution data transfer between the fdd and system. fdc reads all of cylinders' contents from index hole to eot. result r ------- st0 ------- status information after command execution. r ------- st1 ------- r ------- st2 ------- r -------- c -------- sector id information after command execution. r -------- h -------- r -------- r -------- r -------- n --------
smsc ds ? FDC37N958FR page 55 rev. 09/01/99 verify data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w mt mfm sk 1 0 1 1 0 command codes w ec 0 0 0 0 hds ds1 ds0 w -------- c -------- sector id information prior to command execution. w -------- h -------- w -------- r -------- w -------- n -------- w ------- eot ------- w ------- gpl ------- w ------ dtl/sc ------ execution no data transfer takes place. result r ------- st0 ------- status information after command execution. r ------- st1 ------- r ------- st2 ------- r -------- c -------- sector id information after command execution. r -------- h -------- r -------- r -------- r -------- n -------- version data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 1 0 0 0 0 command code result r 1 0 0 1 0 0 0 0 enhanced controller
smsc ds ? FDC37N958FR page 56 rev. 09/01/99 format a track data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 mfm 0 0 1 1 0 1 command codes w 0 0 0 0 0 hds ds1 ds0 w -------- n -------- bytes/sector w -------- sc -------- sectors/cylinder w ------- gpl ------- gap 3 w -------- d -------- filler byte execution for each sector repeat: w -------- c -------- input sector parameters w -------- h -------- w -------- r -------- w -------- n -------- fdc formats an entire cylinder result r ------- st0 ------- status information after command execution r ------- st1 ------- r ------- st2 ------- r ------ undefined ------ r ------ undefined ------ r ------ undefined ------ r ------ undefined ------ recalibrate data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 0 0 1 1 1 command codes w 000000ds1ds0 execution head retracted to track 0 interrupt.
smsc ds ? FDC37N958FR page 57 rev. 09/01/99 sense interrupt status data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 0 1 0 0 0 command codes result r ------- st0 ------- status information at the end of each seek operation. r ------- pcn ------- specify data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 0 0 0 1 1 command codes w --- srt --- --- hut --- w ------ hlt ------ nd sense drive status data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 0 0 1 0 0 command codes w 0 0 0 0 0 hds ds1 ds0 result r ------- st3 ------- status information about fdd
smsc ds ? FDC37N958FR page 58 rev. 09/01/99 seek data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 0 1 1 1 1 command codes w 0 0 0 0 0 hds ds1 ds0 w ------- ncn ------- execution head positioned over proper cylinder on diskette. configure data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 1 0 0 1 1 configure information w000 00000 w 0 eis efifo poll --- fifothr --- execution w --------- pretrk --------- relative seek data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 1 dir 0 0 1 1 1 1 w 0 0 0 0 0 hds ds1 ds0 w ------- rcn -------
smsc ds ? FDC37N958FR page 59 rev. 09/01/99 dumpreg data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 0 1 1 1 0 *note: registers placed in fifo execution result r ------ pcn-drive 0 ------- r ------ pcn-drive 1 ------- r ------ pcn-drive 2 ------- r ------ pcn-drive 3 ------- r ---- srt ---- --- hut --- r ------- hlt ------- nd r ------- sc/eot ------- r lock 0 d3 d2 d1 d0 gap wgate r 0 eis efifo poll -- fifothr -- r -------- pretrk --------
smsc ds ? FDC37N958FR page 60 rev. 09/01/99 read id data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 mfm 0 0 1 0 1 0 commands w 0 0 0 0 0 hds ds1 ds0 execution the first correct id information on the cylinder is stored in data register result r -------- st0 -------- status information after command execution. disk status after the command has completed r -------- st1 -------- r -------- st2 -------- r -------- c -------- r -------- h -------- r -------- r -------- r -------- n -------- perpendicular mode data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w 0 0 0 1 0 0 1 0 command codes ow 0 d3 d2 d1 d0 gap wgate
smsc ds ? FDC37N958FR page 61 rev. 09/01/99 invalid codes data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w ----- invalid codes ----- invalid command codes (noop - fdc goes into stand- by state) result r ------- st0 ------- st0 = 80h lock data bus phase r/w d7 d6 d5 d4 d3 d2 d1 d0 remarks command w lock 0 0 1 0 1 0 0 command codes result r 0 00lock0000 sc is returned if the last command that was issued was the format command. eot is returned if the last command was a read or write. note: these bits are used internally only. they are not reflected in the drive select pins. it is the user's responsibility to maintain correspondence between these bits and the drive select pins (dor).
smsc ds ? FDC37N958FR page 62 rev. 09/01/99 fdc data transfer commands all of the read data, write data and verify type commands use the same parameter bytes and return the same results information, the only difference being the coding of bits 0-4 in the first byte. an implied seek will be executed if the feature was enabled by the configure command. this seek is completely transparent to the user. the drive busy bit for the drive will go active in the main status register during the seek portion of the command. if the seek portion fails, it will be reflected in the results status normally returned for a read/write data command. status register 0 (st0) would contain the error code and c would contain the cylinder on which the seek failed. read data a set of nine (9) bytes is required to place the fdc in the read data mode. after the read data command has been issued, the fdc loads the head (if it is in the unloaded state), waits the specified head settling time (defined in the specify command), and begins reading id address marks and id fields. when the sector address read off the diskette matches with the sector address specified in the command, the fdc reads the sector's data field and transfers the data to the fifo. after completion of the read operation from the current sector, the sector address is incremented by one and the data from the next logical sector is read and output via the fifo. this continuous read function is called "multi-sector read operation". upon receipt of tc, or an implied tc (fifo overrun/underrun), the fdc stops sending data but will continue to read data from the current sector, check the crc bytes, and at the end of the sector, terminate the read data command. n determines the number of bytes per sector (see table 26 below). if n is set to zero, the sector size is set to 128. the dtl value determines the number of bytes to be transferred. if dtl is less than 128, the fdc transfers the specified number of bytes to the host. for reads, it continues to read the entire 128-byte sector and checks for crc errors. for writes, it completes the 128-byte sector by filling in zeros. if n is not set to 00 hex, dtl should be set to ff hex and has no impact on the number of bytes transferred. the amount of data which can be handled with a single command to the fdc depends upon mt (multi-track) and n (number of bytes/sector). table 26 - sector sizes n sector size 00 01 02 03 .. 07 128 bytes 256 bytes 512 bytes 1024 bytes ... 16 kbytes
smsc ds ? FDC37N958FR page 63 rev. 09/01/99 the multi-track function (mt) allows the fdc to read data from both sides of the diskette. for a particular cylinder, data will be transferred starting at sector 1, side 0 and completing the last sector of the same track at side 1. if the host terminates a read or write operation in the fdc, the id information in the result phase is dependent upon the state of the mt bit and eot byte. at the completion of the read data command, the head is not unloaded until after the head unload time interval (specified in the specify command) has elapsed. if the host issues another command before the head unloads, then the head settling time may be saved between subsequent reads. if the fdc detects a pulse on the nindex pin twice without finding the specified sector (meaning that the diskette's index hole passes through index detect logic in the drive twice), the fdc sets the ic code in status register 0 to "01" indicating abnormal termination, sets the nd bit in status register 1 to "1" indicating a sector not found, and terminates the read data command. after reading the id and data fields in each sector, the fdc checks the crc bytes. if a crc error occurs in the id or data field, the fdc sets the ic code in status register 0 to "01" indicating abnormal termination, sets the de bit flag in status register 1 to "1", sets the dd bit in status register 2 to "1" if crc is incorrect in the id field, and terminates the read data command. table 28 describes the effect of the sk bit on the read data command execution and results. except where noted in table 28, the c or r value of the sector address is automatically incremented (see table 30). table 27 - effects of mt and n bits mt n maximum transfer capacity final sector read from disk 0 1 0 1 0 1 1 1 2 2 3 3 256 x 26 = 6,656 256 x 52 = 13,312 512 x 15 = 7,680 512 x 30 = 15,360 1024 x 8 = 8,192 1024 x 16 = 16,384 26 at side 0 or 1 26 at side 1 15 at side 0 or 1 15 at side 1 8 at side 0 or 1 16 at side 1
smsc ds ? FDC37N958FR page 64 rev. 09/01/99 table 28 - skip bit vs read data command sk bit value data address mark type encountered results sector read? cm bit of st2 set? description of results 0 normal data yes no normal termination 0 deleted data yes yes address not incremented. next sector not searched for 1 normal data yes no normal termination 1 deleted data no yes normal termination. sector not read ("skipped") read deleted data this command is the same as the read data command, only it operates on sectors that contain a deleted data address mark at the beginning of a data field. table 29 describes the effect of the sk bit on the read deleted data command execution and results. except where noted in table 29, the c or r value of the sector address is automatically incremented (see table 30).
smsc ds ? FDC37N958FR page 65 rev. 09/01/99 table 29 - skip bit vs. read deleted data command sk bit value data address mark type encountered results sector read? cm bit of st2 set? description of results 0 normal data yes yes address not incremented. next sector not searched for 0 deleted data yes no normal termination 1 normal data no yes normal termination. sector not read ("skipped") 1 deleted data yes no normal termination read a track this command is similar to the read data command except that the entire data field is read continuously from each of the sectors of a track. immediately after encountering a pulse on the nindex pin, the fdc starts to read all data fields on the track as continuous blocks of data without regard to logical sector numbers. if the fdc finds an error in the id or data crc check bytes, it continues to read data from the track and sets the appropriate error bits at the end of the command. the fdc compares the id information read from each sector with the specified value in the command and sets the nd flag of status register 1 to a "1" if there is no comparison. multi-track or skip operations are not allowed with this command. the mt and sk bits (bits d7 and d5 of the first command byte respectively) should always be set to "0". this command terminates when the eot specified number of sectors has not been read. if the fdc does not find an id address mark on the diskette after the second occurrence of a pulse on the idx pin, then it sets the ic code in status register 0 to "01" (abnormal termination), sets the ma bit in status register 1 to "1", and terminates the command.
smsc ds ? FDC37N958FR page 66 rev. 09/01/99 table 30 - result phase table mt head final sector transferred to host id information at result phase chr n 0 0 less than eot nc nc r + 1 nc equal to eot c + 1 nc 01 nc 1 less than eot nc nc r + 1 nc equal to eot c + 1 nc 01 nc 1 0 less than eot nc nc r + 1 nc equal to eot nc lsb 01 nc 1 less than eot nc nc r + 1 nc equal to eot c + 1 lsb 01 nc nc: no change, the same value as the one at the beginning of command execution. lsb: least significant bit, the lsb of h is complemented. write data after the write data command has been issued, the fdc loads the head (if it is in the unloaded state), waits the specified head load time if unloaded (defined in the specify command), and begins reading id fields. when the sector address read from the diskette matches the sector address specified in the command, the fdc reads the data from the host via the fifo and writes it to the sector's data field. after writing data into the current sector, the fdc computes the crc value and writes it into the crc field at the end of the sector transfer. the sector number stored in "r" is incremented by one, and the fdc continues writing to the next data field. the fdc continues this "multi-sector write operation". upon receipt of a terminal count signal or if a fifo over/under run occurs while a data field is being written, then the remainder of the data field is filled with zeros. the fdc reads the id field of each sector and checks the crc bytes. if it detects a crc error in one of the id fields, it sets the ic code in status register 0 to "01" (abnormal termination), sets the de bit of status register 1 to "1", and terminates the write data command.
smsc ds ? FDC37N958FR page 67 rev. 09/01/99 the write data command operates in much the same manner as the read data command. the following items are the same. please refer to the read data command for details: ! transfer capacity ! en (end of cylinder) bit ! nd (no data) bit ! head load, unload time interval ! id information when the host terminates the command ! definition of dtl when n = 0 and when n does not = 0 write deleted data this command is almost the same as the write data command except that a deleted data address mark is written at the beginning of the data field instead of the normal data address mark. this command is typically used to mark a bad sector containing an error on the floppy disk. verify the verify command is used to verify the data stored on a disk. this command acts exactly like a read data command except that no data is transferred to the host. data is read from the disk and crc is computed and checked against the previously-stored value. because data is not transferred to the host, tc (pin 94) cannot be used to terminate this command. by setting the ec bit to "1", an implicit tc will be issued to the fdc. this implicit tc will occur when the sc value has decremented to 0 (an sc value of 0 will verify 256 sectors). this command can also be terminated by setting the ec bit to "0" and the eot value equal to the final sector to be checked. if ec is set to "0", dtl/sc should be programmed to 0ffh. refer to table 30 and table 31 for information concerning the values of mt and ec versus sc and eot value. definitions: # sectors per side = number of formatted sectors per each side of the disk. # sectors remaining = number of formatted sectors left which can be read, including side 1 of the disk if mt is set to "1".
smsc ds ? FDC37N958FR page 68 rev. 09/01/99 table 31 - verify command result phase table mt ec sc/eot value termination result 00sc = dtl eot & # sectors per side success termination result phase valid 00sc = dtl eot > # sectors per side unsuccessful termination result phase invalid 01 sc & # sectors remaining and eot & # sectors per side successful termination result phase valid 0 1 sc > # sectors remaining or eot > # sectors per side unsuccessful termination result phase invalid 10sc = dtl eot & # sectors per side successful termination result phase valid 10sc = dtl eot > # sectors per side unsuccessful termination result phase invalid 11 sc & # sectors remaining and eot & # sectors per side successful termination result phase valid 1 1 sc > # sectors remaining or eot > # sectors per side unsuccessful termination result phase invalid note: if mt is set to "1" and the sc value is greater than the number of remaining formatted sectors on side 0, verifying will continue on side 1 of the disk. format a track the format command allows an entire track to be formatted. after a pulse from the idx pin is detected, the fdc starts writing data on the disk including gaps, address marks, id fields, and data fields per the ibm system 34 or 3740 format (mfm or fm respectively). the particular values that will be written to the gap and data field are controlled by the values programmed into n, sc, gpl, and d which are specified by the host during the command phase. the data field of the sector is filled with the data byte specified by d. the id field for each sector is supplied by the host; that is, four data bytes per sector are needed by the fdc for c, h, r, and n (cylinder, head, sector number and sector size respectively). after formatting each sector, the host must send new values for c, h, r and n to the fdc for the next sector on the track. the r value (sector number) is the only value that must be changed by the host after each sector is formatted. this allows the disk to be formatted with nonsequential sector addresses (interleaving). this incrementing and formatting continues for the whole track until the fdc encounters a pulse on the idx pin again and it terminates the command. table 33 contains typical values for gap fields which are dependent upon the size of the sector and the number of sectors on each track. actual values can vary due to drive electronics.
smsc ds ? FDC37N958FR page 69 rev. 09/01/99 table 32 - diskette format fields system 34 (double density) format gap4a 80x 4e sync 12x 00 iam gap1 50x 4e sync 12x 00 idam c y l h d s e c n o c r c gap2 22x 4e sync 12x 00 data am data c r c gap3 gap 4b 3x c2 fc 3x a1 fe 3x a1 fb f8 system 3740 (single density) format gap4a 40x ff sync 6x 00 iam gap1 26x ff sync 6x 00 idam c y l h d s e c n o c r c gap2 11x ff sync 6x 00 data am data c r c gap3 gap 4b fc fe fb or f8 perpendicular format gap4a 80x 4e sync 12x 00 iam gap1 50x 4e sync 12x 00 idam c y l h d s e c n o c r c gap2 41x 4e sync 12x 00 data am data c r c gap3 gap 4b 3x c2 fc 3x a1 fe 3x a1 fb f8
smsc ds ? FDC37N958FR page 70 rev. 09/01/99 table 33 - typical values for formatting format sector size n sc gpl1 gpl2 5.25" drives fm 128 128 512 1024 2048 4096 ... 00 00 02 03 04 05 ... 12 10 08 04 02 01 07 10 18 46 c8 c8 09 19 30 87 ff ff mfm 256 256 512* 1024 2048 4096 ... 01 01 02 03 04 05 ... 12 10 09 04 02 01 0a 20 2a 80 c8 c8 0c 32 50 f0 ff ff 3.5" drives fm 128 256 512 0 1 2 0f 09 05 07 0f 1b 1b 2a 3a mfm 256 512** 1024 1 2 3 0f 09 05 0e 1b 35 36 54 74 gpl1 = suggested gpl values in read and write commands to avoid splice point between data field and id field of contiguous sections. gpl2 = suggested gpl value in format a track command. *pc/at values (typical) **ps/2 values (typical). applies with 1.0 mb and 2.0 mb drives. note: all values except sector size are in hex.
smsc ds ? FDC37N958FR page 71 rev. 09/01/99 fdc control commands control commands differ from the other commands in that no data transfer takes place. three commands generate an interrupt when complete: read id, recalibrate, and seek. the other control commands do not generate an interrupt. read id the read id command is used to find the present position of the recording heads. the fdc stores the values from the first id field it is able to read into its registers. if the fdc does not find an id address mark on the diskette after the second occurrence of a pulse on the nindex pin, it then sets the ic code in status register 0 to "01" (abnormal termination), sets the ma bit in status register 1 to "1", and terminates the command. the following commands will generate an interrupt upon completion. they do not return any result bytes. it is highly recommended that control commands be followed by the sense interrupt status command. otherwise, valuable interrupt status information will be lost. recalibrate this command causes the read/write head within the fdc to retract to the track 0 position. the fdc clears the contents of the pcn counter and checks the status of the ntr0 pin from the fdd. as long as the ntr0 pin is low, the dir pin remains 0 and step pulses are issued. when the ntr0 pin goes high, the se bit in status register 0 is set to "1" and the command is terminated. if the ntr0 pin is still low after 79 step pulses have been issued, the fdc sets the se and the ec bits of status register 0 to "1" and terminates the command. disks capable of handling more than 80 tracks per side may require more than one recalibrate command to return the head back to physical track 0. the recalibrate command does not have a result phase. the sense interrupt status command must be issued after the recalibrate command to effectively terminate it and to provide verification of the head position (pcn). during the command phase of the recalibrate operation, the fdc is in the busy state, but during the execution phase it is in a non-busy state. at this time, another recalibrate command may be issued, and in this manner parallel recalibrate operations may be done on up to four drives at once. upon power up, the software must issue a recalibrate command to properly initialize all drives and the controller. seek the read/write head within the drive is moved from track to track under the control of the seek command. the fdc compares the pcn, which is the current head position, with the ncn and performs the following operation if there is a difference: pcn < ncn: direction signal to drive set to "1" (step in) and issues step pulses. pcn > ncn: direction signal to drive set to "0" (step out) and issues step pulses. the rate at which step pulses are issued is controlled by srt (stepping rate time) in the specify command. after each step pulse is issued, ncn is compared against pcn, and when ncn = pcn the se bit in status register 0 is set to "1" and the command is terminated. during the command phase of the seek or recalibrate operation, the fdc is in the busy state, but during the execution phase it is in the non-busy state. at this time, another seek or
smsc ds ? FDC37N958FR page 72 rev. 09/01/99 recalibrate command may be issued, and in this manner, parallel seek operations may be done on up to four drives at once. note that if implied seek is not enabled, the read and write commands should be preceded by: 1. seek command - step to the proper track 2. sense interrupt status command - terminate the seek command 3. read id - verify head is on proper track 4. issue read/write command. the seek command does not have a result phase. therefore, it is highly recommended that the sense interrupt status command be issued after the seek command to terminate it and to provide verification of the head position (pcn). the h bit (head address) in st0 will always return to a "0". when exiting powerdown mode, the fdc clears the pcn value and the status information to zero. prior to issuing the powerdown command, it is highly recommended that the user service all pending interrupts through the sense interrupt status command. sense interrupt status an interrupt signal on the fdc?s irq pin is generated by the fdc for one of the following reasons: 1. upon entering the result phase of: a. read data command b. read a track command c. read id command d. read deleted data command e. write data command f. format a track command g. write deleted data command h. verify command 2. end of seek, relative seek, or recalibrate command 3. fdc requires a data transfer during the execution phase in the non-dma mode the sense interrupt status command resets the interrupt signal and, via the ic code and se bit of status register 0, identifies the cause of the interrupt. the seek, relative seek, and recalibrate commands have no result phase. the sense interrupt status command must be issued immediately after these commands to terminate them and to provide verification of the head position (pcn). the h (head address) bit in st0 will always return a "0". if a sense interrupt status is not issued, the drive will continue to be busy and may affect the operation of the next command. table 34 - interrupt identification se ic interrupt due to 0 1 1 11 00 01 polling normal termination of seek or recalibrate command abnormal termination of seek or recalibrate command
smsc ds ? FDC37N958FR page 73 rev. 09/01/99 sense drive status sense drive status obtains drive status information. it has no execution phase and goes directly to the result phase from the command phase. status register 3 contains the drive status information. specify the specify command sets the initial values for each of the three internal times. the hut (head unload time) defines the time from the end of the execution phase of one of the read/write commands to the head unload state. the srt (step rate time) defines the time interval between adjacent step pulses. note that the spacing between the first and second step pulses may be shorter than the remaining step pulses. the hlt (head load time) defines the time between when the head load signal goes high and the read/write operation starts. the values change with the data rate speed selection and are documented in table 35 - drive control delays (ms). the values are the same for mfm and fm. table 35 - drive control delays(ms) hut srt 2m 1m 500k 300k 250k 2m 1m 500k 300k 250k 0 1 .. e f 64 4 .. 56 60 128 8 .. 112 120 256 16 .. 224 240 426 26.7 .. 373 400 512 32 .. 448 480 4 3.75 .. 0.5 0.25 8 7.5 .. 1 0.5 16 15 .. 2 1 26.7 25 .. 3.33 1.67 32 30 .. 4 2 hlt 2m 1m 500k 300k 250k 00 01 02 .. 7f 7f 64 0.5 1 .. 63 63.5 128 1 2 .. 126 127 256 2 4 .. 252 254 426 3.3 6.7 .. 420 423 512 4 8 . 504 508 the choice of dma or non-dma operations is made by the nd bit. when this bit is "1", the non- dma mode is selected, and when nd is "0", the dma mode is selected. in dma mode, data transfers are signalled by the fdc?s drq pin. non-dma mode uses the rqm bit and the fdc?s irq pin to signal data transfers.
smsc ds ? FDC37N958FR page 74 rev. 09/01/99 configure the configure command is issued to select the special features of the fdc. a configure command need not be issued if the default values of the fdc meet the system requirements. configure default values: eis - no implied seeks efifo - fifo disabled poll - polling enabled fifothr - fifo threshold set to 1 byte pretrk - pre-compensation set to track 0 eis - enable implied seek. when set to "1", the fdc will perform a seek operation before executing a read or write command. defaults to no implied seek. efifo - a "1" disables the fifo (default). this means data transfers are asked for on a byte-by- byte basis. defaults to "1", fifo disabled. the threshold defaults to "1". poll - disable polling of the drives. defaults to "0", polling enabled. when enabled, a single interrupt is generated after a reset. no polling is performed while the drive head is loaded and the head unload delay has not expired. fifothr - the fifo threshold in the execution phase of read or write commands. this is programmable from 1 to 16 bytes. defaults to one byte. a "00" selects one byte; "0f" selects 16 bytes. pretrk - pre-compensation start track number. programmable from track 0 to 255. defaults to track 0. a "00" selects track 0; "ff" selects track 255. version the version command checks to see if the controller is an enhanced type or the older type (765a). a value of 90 h is returned as the result byte. relative seek the command is coded the same as for seek, except for the msb of the first byte and the dir bit. dir action 0 1 step head out step head in dir head step direction control rcn relative cylinder number that determines how many tracks to step the head in or out from the current track number. the relative seek command differs from the seek command in that it steps the head the absolute number of tracks specified in the command instead of making a comparison against an internal register. the seek command is good for drives that support a maximum of 256 tracks. relative seeks cannot be overlapped with other relative seeks. only one relative seek can be active at a time. relative seeks may be overlapped with seeks and recalibrates. bit 4 of status register 0 (ec) will be set if relative seek attempts to step outward beyond track 0. as an example, assume that a floppy drive has 300 useable tracks. the host needs to read track 300 and the head is on any track (0-255). if a seek command is issued, the head will stop at track 255. if a relative seek command is issued, the fdc will move the head the specified number of tracks, regardless of the internal cylinder position register (but will increment the register). if the head was on track 40 (d), the maximum track that the fdc could position the head on using relative seek will be 295 (d), the initial track + 255 (d). the maximum count that the head can be moved with a single relative seek command is 255 (d).
smsc ds ? FDC37N958FR page 75 rev. 09/01/99 the internal register, pcn, will overflow as the cylinder number crosses track 255 and will contain 39 (d). the resulting pcn value is thus (rcn + pcn) mod 256. functionally, the fdc starts counting from 0 again as the track number goes above 255 (d). it is the user's responsibility to compensate fdc functions (precompensation track number) when accessing tracks greater than 255. the fdc does not keep track that it is working in an "extended track area" (greater than 255). any command issued will use the current pcn value except for the recalibrate command, which only looks for the track0 signal. recalibrate will return an error if the head is farther than 79 due to its limitation of issuing a maximum of 80 step pulses. the user simply needs to issue a second recalibrate command. the seek command and implied seeks will function correctly within the 44 (d) track (299-255) area of the "extended track area". it is the user's responsibility not to issue a new track position that will exceed the maximum track that is present in the extended area. to return to the standard floppy range (0-255) of tracks, a relative seek should be issued to cross the track 255 boundary. a relative seek can be used instead of the normal seek, but the host is required to calculate the difference between the current head location and the new (target) head location. this may require the host to issue a read id command to ensure that the head is physically on the track that software assumes it to be. different fdc commands will return different cylinder results which may be difficult to keep track of with software without the read id command. perpendicular mode the perpendicular mode command should be issued prior to executing read/write/format commands that access a disk drive with perpendicular recording capability. with this command, the length of the gap2 field and vco enable timing can be altered to accommodate the unique requirements of these drives. table 36 describes the effects of the wgate and gap bits for the perpendicular mode command. upon a reset, the fdc will default to the conventional mode (wgate = 0, gap = 0). selection of the 500 kbps and 1 mbps perpendicular modes is independent of the actual data rate selected in the data rate select register. the user must ensure that these two data rates remain consistent. the gap2 and vco timing requirements for perpendicular recording type drives are dictated by the design of the read/write head. in the design of this head, a pre-erase head precedes the normal read/write head by a distance of 200 micrometers. this works out to about 38 bytes at a 1 mbps recording density. whenever the write head is enabled by the write gate signal, the pre- erase head is also activated at the same time. thus, when the write head is initially turned on, flux transitions recorded on the media for the first 38 bytes will not be preconditioned with the pre- erase head since it has not yet been activated. to accommodate this head activation and deactivation time, the gap2 field is expanded to a length of 41 bytes. the format field illustrates the change in the gap2 field size for the perpendicular format. on the read back by the fdc, the controller must begin synchronization at the beginning of the sync field. for the conventional mode, the internal pll vco is enabled (vcoen) approximately 24 bytes from the start of the gap2 field. but, when the controller operates in the 1 mbps perpendicular mode (wgate = 1, gap = 1), vcoen goes active after 43 bytes to accommodate the increased gap2 field size. for both cases, and approximate two-byte cushion is maintained from the beginning of the sync field for the purposes of avoiding write splices in the presence of motor speed variation. for the write data case, the fdc activates write gate at the beginning of the sync field under the conventional mode. the controller then writes a new sync field, data address mark, data field, and crc. with the pre-erase head of the perpendicular drive, the write head must be activated in the gap2 field to insure a proper write of the new sync field. for the 1 mbps perpendicular mode (wgate = 1, gap = 1), 38 bytes will be written in the gap2 space. since the
smsc ds ? FDC37N958FR page 76 rev. 09/01/99 bit density is proportional to the data rate, 19 bytes will be written in the gap2 field for the 500 kbps perpendicular mode (wgate = 1, gap =0). it should be noted that none of the alterations in gap2 size, vco timing, or write gate timing affect normal program flow. the information provided here is just for background purposes and is not needed for normal operation. once the perpendicular mode command is invoked, fdc software behavior from the user standpoint is unchanged. the perpendicular mode command is enhanced to allow specific drives to be designated perpendicular recording drives. this enhancement allows data transfers between conventional and perpendicular drives without having to issue perpendicular mode commands between the accesses of the different drive types, nor having to change write pre-compensation values. when both gap and wgate bits of the perpendicular mode command are both programmed to "0" (conventional mode), then d0, d1, d2, d3, and d4 can be programmed independently to "1" for that drive to be set automatically to perpendicular mode. in this mode the following set of conditions also apply: 1. the gap2 written to a perpendicular drive during a write operation will depend upon the programmed data rate. 2. the write pre-compensation given to a perpendicular mode drive will be 0ns. 3. for d0-d3 programmed to "0" for conventional mode drives any data written will be at the currently programmed write pre- compensation. note: bits d0-d3 can only be overwritten when ow is programmed as a "1". if either gap or wgate is a "1" then d0-d3 are ignored. software and hardware resets have the following effect on the perpendicular mode command: 1. "software" resets (via the dor or dsr registers) will only clear gap and wgate bits to "0". d0-d3 are unaffected and retain their previous value. 2. "hardware" resets will clear all bits (gap, wgate and d0-d3) to "0", i.e all conventional mode.
smsc ds ? FDC37N958FR page 77 rev. 09/01/99 table 36 - effects of wgate and gap bits wgate gap mode length of gap2 format field portion of gap 2 written by write data operation 0 0 1 1 0 1 0 1 conventional perpendicular (500 kbps) reserved (conventional) perpendicular (1 mbps) 22 bytes 22 bytes 22 bytes 41 bytes 0 bytes 19 bytes 0 bytes 38 bytes lock in order to protect systems with long dma latencies against older application software that can disable the fifo the lock command has been added. this command should only be used by the fdc routines, and application software should refrain from using it. if an application calls for the fifo to be disabled then the configure command should be used. the lock command defines whether the efifo, fifothr, and pretrk parameters of the configure command can be reset by the dor and dsr registers. when the lock bit is set to logic "1" all subsequent "software resets by the dor and dsr registers will not change the previously set parameters to their default values. all "hardware" reset from the reset pin will set the lock bit to logic "0" and return the efifo, fifothr, and pretrk to their default values. a status byte is returned immediately after issuing a a lock command. this byte reflects the value of the lock bit set by the command byte. enhanced dumpreg the dumpreg command is designed to support system run-time diagnostics and application software development and debug. to accommodate the lock command and the enhanced perpendicular mode command the eighth byte of the dumpreg command has been modified to contain the additional data from these two commands. compatibility the FDC37N958FR was designed with software compatibility in mind. it is a fully backwards- compatible solution with the older generation 765a/b disk controllers. the fdc also implements on-board registers for compatibility with the ps/2, as well as pc/at and pc/xt, fdc subsystems. after a hardware reset of the fdc, all registers, functions and enhancements default to a pc/at, ps/2 or ps/2 model 30 compatible operating mode, depending on how the ident and mfm bits are configured by the system bios. parallel port fdc refer to the the parallel port section for details. hot swappable fdd capability the fdc output pins will tri-state whenever the fdc logical device is powered-down or not activated. in addition setting bit 7 of the fdd mode configuration register (ld0_crf0) will tri- state the fdc output pins. bit 7 only affects the standard fdc interface, it has no effect on the parallel port floppy interface.
smsc ds ? FDC37N958FR page 78 rev. 09/01/99 the following table illustrates the state of the fdc and parallel port fdc pins for combinations of 1) the fdc output control bit; 2) the activate bit; and 3) the fdc powerdown state. fdd mode register, bit[7] activate bit fdc in power down fdc pins parallel port fdc pins x 0 x hi-z hi-z x 1 y hi-z hi-z 0 1 n active active 1 1 n hi-z active when the fdc is disabled, powered down or inactive the fdc output pins will tri-state allowing ?hot-swapping? of the floppy disk drive. the following table lists the five control/configuration mechanisms that power down or deactivate the fdc logical device. mechanism fdc output pins state tri- state tri-state tri-state tri-state (note 1) tri-state (note 2) fdc logical dev activate bit =0: fdc ld deactivated =1: fdc ld activated refer to the description of the fdc logical device configuration register 0x30 in the configuration section of the orion specification. 0x 1 1 1 fdc logical dev base address 0x100 < base < 0x0ff8: fdc ld base address valid. 0xfff < base < 0x100: fdc ld base address invalid. refer to the description of the fdc base i/o address registers in the configuration section of the orion specification. x invalid base address valid base address valid base address valid base address gcr 0x22 bit-0 (fdc power) =0: power off =1: power on refer to the description of the global config register 0x22 in the configuration section of the orion specification. xx 0 1 1 dsr, bit-6 (pwr down) =0: normal run =1: manual pwr down refer to the description of the dsr in the fdc section of any smsc super or ultra i/o data sheet. xx x 1 0
smsc ds ? FDC37N958FR page 79 rev. 09/01/99 mechanism fdc output pins state gcr 0x23 bit-0 (fdc auto power management) =1: pwr mngnt on =0: pwr mngnt off refer to the description of the global config register 0x23 in the configuration section of the orion specification. xxxx1 note: fdc output pins = nwdata, drvden0, nhdselm nwgate, ndir, nstep, nds1, nds0, nmtr0, nmtr1. note1: dsr pwr down overrides auto pwr down. note 2: outputs tri-state only if all of the required auto power down conditions are met, otherwise outputs are active. see auto power management section of the fdc37c93x data sheet.
smsc ds ? FDC37N958FR page 80 rev. 09/01/99 serial port (uart) the FDC37N958FR incorporates two full function uarts. they are compatible with the ns16450, the 16450 ace registers and the ns16550a. the uarts perform serial-to-parallel conversion on received characters and parallel-to-serial conversion on transmit characters. the data rates are independently programmable from 460.8k baud down to 50 baud. the character options are programmable for 1 start; 1, 1.5 or 2 stop bits; even, odd, sticky or no parity; and prioritized interrupts. the uarts each contain a programmable baud rate generator that is capable of dividing the input clock or crystal by a number from 1 to 65535. the uarts are also capable of supporting the midi data rate. refer to the configuration registers for information on disabling, power down and changing the base address of the uarts. the interrupt from a uart is enabled by programming out2 of that uart to a logic "1". out2 being a logic "0" disables that uart's interrupt. the second uart also supports irda, hp-sir and ask-ir infrared modes of operation. register description addressing of the accessible registers of the serial port is shown below. the base addresses of the serial ports are defined by the configuration registers (see configuration section). the serial port registers are located at sequentially increasing addresses above these base addresses. the FDC37N958FR contains two serial ports, each of which contain a register set as described below. table 37 - addressing the serial port dlab* a2 a1 a0 register name 0 0 0 0 receive buffer (read) 0 0 0 0 transmit buffer (write) 0 0 0 1 interrupt enable (read/write) x 0 1 0 interrupt identification (read) x 0 1 0 fifo control (write) x 0 1 1 line control (read/write) x 1 0 0 modem control (read/write) x 1 0 1 line status (read/write) x 1 1 0 modem status (read/write) x 1 1 1 scratchpad (read/write) 1 0 0 0 divisor lsb (read/write) 1 0 0 1 divisor msb (read/write note: dlab is bit 7 of the line control register
smsc ds ? FDC37N958FR page 81 rev. 09/01/99 the following section describes the operation of the registers. receive buffer register (rb) address offset = 0h, dlab = 0, read only this register holds the received incoming data byte. bit 0 is the least significant bit, which is transmitted and received first. received data is double buffered; this uses an additional shift register to receive the serial data stream and convert it to a parallel 8 bit word which is transferred to the receive buffer register. the shift register is not accessible. transmit buffer register (tb) address offset = 0h, dlab = 0, write only this register contains the data byte to be transmitted. the transmit buffer is double buffered, utilizing an additional shift register (not accessible) to convert the 8 bit data word to a serial format. this shift register is loaded from the transmit buffer when the transmission of the previous byte is complete. interrupt enable register (ier) address offset = 1h, dlab = 0, read/write the lower four bits of this register control the enables of the five interrupt sources of the serial port interrupt. it is possible to totally disable the interrupt system by resetting bits 0 through 3 of this register. similarly, setting the appropriate bits of this register to a high, selected interrupts can be enabled. disabling the interrupt system inhibits the interrupt identification register and disables any serial port interrupt out of the FDC37N958FR. all other system functions operate in their normal manner, including the line status and modem status registers. the contents of the interrupt enable register are described below. bit 0 this bit enables the received data available interrupt (and timeout interrupts in the fifo mode) when set to logic "1". bit 1 this bit enables the transmitter holding register empty interrupt when set to logic "1". bit 2 this bit enables the received line status interrupt when set to logic "1". the error sources causing the interrupt are overrun, parity, framing and break. the line status register must be read to determine the source. bit 3 this bit enables the modem status interrupt when set to logic "1". this is caused when one of the modem status register bits changes state. bits 4 - 7 these bits are always logic "0". fifo control register (fcr) address offset = 2h, dlab = x, write this is a write only register at the same location as the iir. this register is used to enable and clear the fifos, set the rcvr fifo trigger level. note: dma is not supported. bit 0 setting this bit to a logic "1" enables both the xmit and rcvr fifos. clearing this bit to a logic "0" disables both the xmit and rcvr fifos and clears all bytes from both fifos. when changing from fifo mode to non-fifo (16450) mode, data is automatically cleared from the fifos. this bit must be a 1 when other bits in this register are written to or they will not be properly programmed.
smsc ds ? FDC37N958FR page 82 rev. 09/01/99 bit 1 setting this bit to a logic "1" clears all bytes in the rcvr fifo and resets its counter logic to ?0?. the shift register is not cleared. this bit is self- clearing. bit 2 setting this bit to a logic "1" clears all bytes in the xmit fifo and resets its counter logic to ?0?. the shift register is not cleared. this bit is self- clearing. bit 3 writing to this bit has no effect on the operation of the uart. the rxrdy and txrdy pins are not available on this chip. bits 4 and 5 reserved bits 6 and 7 these bits are used to set the trigger level for the rcvr fifo interrupt. bit 7 bit 6 rcvr fifo trigger level (bytes) 00 1 01 4 10 8 11 14
smsc ds ? FDC37N958FR page 83 rev. 09/01/99 interrupt identification register (iir) address offset = 2h, dlab = x, read by accessing this register, the host cpu can determine the highest priority interrupt and its source. four levels of priority interrupt exist. they are in descending order of priority: 1. receiver line status (highest priority) 2. received data ready 3. transmitter holding register empty 4. modem status (lowest priority) information indicating that a prioritized interrupt is pending and the source of that interrupt is stored in the interrupt identification register (refer to interrupt control table). when the cpu accesses the iir, the serial port freezes all interrupts and indicates the highest priority pending interrupt to the cpu. during this cpu access, even if the serial port records new interrupts, the current indication does not change until access is completed. the contents of the iir are described below. bit 0 this bit can be used in either a hardwired prioritized or polled environment to indicate whether an interrupt is pending. when bit 0 is a logic "0", an interrupt is pending and the contents of the iir may be used as a pointer to the appropriate internal service routine. when bit 0 is a logic "1", no interrupt is pending. bits 1 and 2 these two bits of the iir are used to identify the highest priority interrupt pending as indicated by the interrupt control table. bit 3 in non-fifo mode, this bit is a logic "0". in fifo mode this bit is set along with bit 2 when a timeout interrupt is pending. bits 4 and 5 these bits of the iir are always logic "0". bits 6 and 7 these two bits are set when the fifo control register bit 0 equals 1. table 38 - interrupt control table fifo mode only interrupt identification register interrupt set and reset functions bit 3 bit 2 bit 1 bit 0 priority level interrupt type interrupt source interrupt reset control 0 0 0 1 - none none - 0 1 1 0 highest receiver line status overrun error, parity error, framing error or break interrupt reading the line status register
smsc ds ? FDC37N958FR page 84 rev. 09/01/99 fifo mode only interrupt identification register interrupt set and reset functions 0 1 0 0 second received data available receiver data available read receiver buffer or the fifo drops below the trigger level. 1 1 0 0 second character timeout indication no characters have been removed from or input to the rcvr fifo during the last 4 char times and there is at least 1 char in it during this time reading the receiver buffer register 0 0 1 0 third transmitter holding register empty transmitter holding register empty reading the iir register (if source of interrupt) or writing the transmitter holding register 0 0 0 0 fourth modem status clear to send or data set ready or ring indicator or data carrier detect reading the modem status register
smsc ds ? FDC37N958FR page 85 rev. 09/01/99 line control register (lcr) address offset = 3h, dlab = 0, read/write this register contains the format information of the serial line. the bit definitions are: bits 0 and 1 these two bits specify the number of bits in each transmitted or received serial character. the encoding of bits 0 and 1 is as follows: bit 1 bit 0 word length 0 0 1 1 0 1 0 1 5 bits 6 bits 7 bits 8 bits the start, stop and parity bits are not included in the word length. bit 2 this bit specifies the number of stop bits in each transmitted or received serial character. the following table summarizes the information. bit 2 word length number of stop bits 0-- 1 1 5 bits 1.5 1 6 bits 2 1 7 bits 2 1 8 bits 2 note: the receiver will ignore all stop bits beyond the first, regardless of the number used in transmitting.
smsc ds ? FDC37N958FR page 86 rev. 09/01/99 bit 3 parity enable bit. when bit 3 is a logic "1", a parity bit is generated (transmit data) or checked (receive data) between the last data word bit and the first stop bit of the serial data. (the parity bit is used to generate an even or odd number of 1s when the data word bits and the parity bit are summed). bit 4 even parity select bit. when bit 3 is a logic "1" and bit 4 is a logic "0", an odd number of logic "1"'s is transmitted or checked in the data word bits and the parity bit. when bit 3 is a logic "1" and bit 4 is a logic "1" an even number of bits is transmitted and checked. bit 5 stick parity bit. when bit 3 is a logic "1" and bit 5 is a logic "1", the parity bit is transmitted and then detected by the receiver in the opposite state indicated by bit 4. bit 6 set break control bit. when bit 6 is a logic "1", the transmit data output (txd) is forced to the spacing or logic "0" state and remains there (until reset by a low level bit 6) regardless of other transmitter activity. this feature enables the serial port to alert a terminal in a communications system. bit 7 divisor latch access bit (dlab). it must be set high (logic "1") to access the divisor latches of the baud rate generator during read or write operations. it must be set low (logic "0") to access the receiver buffer register, the transmitter holding register, or the interrupt enable register. modem control register (mcr) address offset = 4h, dlab = x, read/write this 8 bit register controls the interface with the modem or data set (or device emulating a modem). the contents of the modem control register are described below. bit 0 this bit controls the data terminal ready (ndtr) output. when bit 0 is set to a logic "1", the ndtr output is forced to a logic "0". when bit 0 is a logic "0", the ndtr output is forced to a logic "1". bit 1 this bit controls the request to send (nrts) output. bit 1 affects the nrts output in a manner identical to that described above for bit 0. bit 2 this bit controls the output 1 (out1) bit. this bit does not have an output pin and can only be read or written by the cpu. bit 3 output 2 (out2). this bit is used to enable an uart interrupt. when out2 is a logic "0", the serial port interrupt output is forced to a high impedance state - disabled. when out2 is a logic "1", the serial port interrupt outputs are enabled. bit 4 this bit provides the loopback feature for diagnostic testing of the serial port. when bit 4 is set to logic "1", the following occur: 1. the txd is set to the marking state(logic "1"). 2. the receiver serial input (rxd) is disconnected. 3. the output of the transmitter shift register is "looped back" into the receiver shift register input. 4. all modem control inputs (ncts, ndsr, nri and ndcd) are disconnected. 5. the four modem control outputs (ndtr, nrts, out1 and out2) are internally connected to the four modem control inputs (ndsr, ncts, ri, dcd).
smsc ds ? FDC37N958FR page 87 rev. 09/01/99 6. the modem control output pins are forced inactive high. 7. data that is transmitted is immediately received. this feature allows the processor to verify the transmit and receive data paths of the serial port. in the diagnostic mode, the receiver and the transmitter interrupts are fully operational. the modem control interrupts are also operational but the interrupts' sources are now the lower four bits of the modem control register instead of the modem control inputs. the interrupts are still controlled by the interrupt enable register. bits 5 - 7 these bits are permanently set to logic zero. line status register (lsr) address offset = 5h, dlab = x, read/write bit 0 data ready (dr). it is set to a logic "1" whenever a complete incoming character has been received and transferred into the receiver buffer register or the fifo. bit 0 is reset to a logic "0" by reading all of the data in the receive buffer register or the fifo. bit 1 overrun error (oe). bit 1 indicates that data in the receiver buffer register was not read before the next character was transferred into the register, thereby destroying the previous character. in fifo mode, an overrunn error will occur only when the fifo is full and the next character has been completely received in the shift register, the character in the shift register is overwritten but not transferred to the fifo. the oe indicator is set to a logic "1" immediately upon detection of an overrun condition, and reset whenever the line status register is read. bit 2 parity error (pe). bit 2 indicates that the received data character does not have the correct even or odd parity, as selected by the even parity select bit. the pe is set to a logic "1" upon detection of a parity error and is reset to a logic "0" whenever the line status register is read. in the fifo mode this error is associated with the particular character in the fifo it applies to. this error is indicated when the associated character is at the top of the fifo. bit 3 framing error (fe). bit 3 indicates that the received character did not have a valid stop bit. bit 3 is set to a logic "1" whenever the stop bit following the last data bit or parity bit is detected as a zero bit (spacing level). the fe is reset to a logic "0" whenever the line status register is read. in the fifo mode this error is associated with the particular character in the fifo it applies to. this error is indicated when the associated character is at the top of the fifo. the serial port will try to resynchronize after a framing error. to do this, it assumes that the framing error was due to the next start bit, so it samples this 'start' bit twice and then takes in the 'data'. bit 4 break interrupt (bi). bit 4 is set to a logic "1" whenever the received data input is held in the spacing state (logic "0") for longer than a full word transmission time (that is, the total time of the start bit + data bits + parity bits + stop bits). the bi is reset after the cpu reads the contents of the line status register. in the fifo mode this error is associated with the particular character in the fifo it applies to. this error is indicated when the associated character is at the top of the fifo. when break occurs only one zero character is loaded into the fifo. restarting after a break is received, requires the serial data (rxd) to be logic "1" for at least 1/2 bit time. note: bits 1 through 4 are the error conditions that produce a
smsc ds ? FDC37N958FR page 88 rev. 09/01/99 receiver line status interrupt whenever any of the corresponding conditions are detected and the interrupt is enabled. bit 5 transmitter holding register empty (thre). bit 5 indicates that the serial port is ready to accept a new character for transmission. in addition, this bit causes the serial port to issue an interrupt when the transmitter holding register interrupt enable is set high. the thre bit is set to a logic "1" when a character is transferred from the transmitter holding register into the transmitter shift register. the bit is reset to logic "0" whenever the cpu loads the transmitter holding register. in the fifo mode this bit is set when the xmit fifo is empty, it is cleared when at least 1 byte is written to the xmit fifo. bit 5 is a read only bit. bit 6 transmitter empty (temt). bit 6 is set to a logic "1" whenever the transmitter holding register (thr) and transmitter shift register (tsr) are both empty. it is reset to logic "0" whenever either the thr or tsr contains a data character. bit 6 is a read only bit. in the fifo mode this bit is set whenever the thr and tsr are both empty, bit 7 this bit is permanently set to logic "0" in the 450 mode. in the fifo mode, this bit is set to a logic "1" when there is at least one parity error, framing error or break indication in the fifo. this bit is cleared when the lsr is read if there are no subsequent errors in the fifo. modem status register (msr) address offset = 6h, dlab = x, read/write this 8 bit register provides the current state of the control lines from the modem (or peripheral device). in addition to this current state information, four bits of the modem status register (msr) provide change information. these bits are set to logic "1" whenever a control input from the modem changes state. they are reset to logic "0" whenever the modem status register is read. bit 0 delta clear to send (dcts). bit 0 indicates that the ncts input to the chip has changed state since the last time the msr was read. bit 1 delta data set ready (ddsr). bit 1 indicates that the ndsr input has changed state since the last time the msr was read. bit 2 trailing edge of ring indicator (teri). bit 2 indicates that the nri input has changed from logic "0" to logic "1". bit 3 delta data carrier detect (ddcd). bit 3 indicates that the ndcd input to the chip has changed state. note: whenever bit 0, 1, 2, or 3 is set to a logic "1", a modem status interrupt is generated. bit 4 this bit is the complement of the clear to send (ncts) input. if bit 4 of the mcr is set to logic "1", this bit is equivalent to nrts in the mcr. bit 5 this bit is the complement of the data set ready (ndsr) input. if bit 4 of the mcr is set to logic "1", this bit is equivalent to dtr in the mcr. bit 6 this bit is the complement of the ring indicator (nri) input. if bit 4 of the mcr is set to logic "1", this bit is equivalent to out1 in the mcr.
smsc ds ? FDC37N958FR page 89 rev. 09/01/99 bit 7 this bit is the complement of the data carrier detect (ndcd) input. if bit 4 of the mcr is set to logic "1", this bit is equivalent to out2 in the mcr. scratchpad register (scr) address offset =7h, dlab =x, read/write this 8 bit read/write register has no effect on the operation of the serial port. it is intended as a scratchpad register to be used by the programmer to hold data temporarily. programmable baud rate generator (and divisor latches dlh, dll) the serial port contains a programmable baud rate generator that is capable of taking any clock input (dc to 3 mhz) and dividing it by any divisor from 1 to 65535. this output frequency of the baud rate generator is 16x the baud rate. two 8 bit latches store the divisor in 16 bit binary format. these divisor latches must be loaded during initialization in order to insure desired operation of the baud rate generator. upon loading either of the divisor latches, a 16 bit baud counter is immediately loaded. this prevents long counts on initial load. if a 0 is loaded into the brg registers the output divides the clock by the number 3. if a 1 is loaded the output is the inverse of the input oscillator. if a two is loaded the output is a divide by 2 signal with a 50% duty cycle. if a 3 or greater is loaded the output is low for 2 bits and high for the remainder of the count. the input clock to the brg is the 24 mhz crystal divided by 13, giving a 1.8462 mhz clock. table 39 shows the baud rates possible with a 1.8462 mhz crystal.
smsc ds ? FDC37N958FR page 90 rev. 09/01/99 table 39 - uart baud rates desired baud rate divisor used to generate 16x clock percent error difference between desired and actual* crxx: bit 7 or 6 50 2304 0.001 x 75 1536 - x 110 1047 - x 134.5 857 0.004 x 150 768 - x 300 384 - x 600 192 - x 1200 96 - x 1800 64 - x 2000 58 0.005 x 2400 48 - x 3600 32 - x 4800 24 - x 7200 16 - x 9600 12 - x 19200 6 - x 38400 3 0.030 x 57600 2 0.16 x 115200 1 0.16 x 230400 32770 0.16 1 460800 32769 0.16 1 *note: the percentage error for all baud rates, except where indicated otherwise, is 0.2%. baud rates using 1.8462 mhz clock for <=38.4; using 1.843 mhz clock for 115.2k; using 3.6864 mhz clock for 230.4k; using 7.3728 mhz clock for 460.8k
smsc ds ? FDC37N958FR page 91 rev. 09/01/99 fifo interrupt mode operation when the rcvr fifo and receiver interrupts are enabled (fcr bit 0 = "1", ier bit 0 = "1"), rcvr interrupts occur as follows: a. the receive data available interrupt will be issued when the fifo has reached its programmed trigger level; it is cleared as soon as the fifo drops below its programmed trigger level. b. the iir receive data available indication also occurs when the fifo trigger level is reached. it is cleared when the fifo drops below the trigger level. c. the receiver line status interrupt (iir=06h), has higher priority than the received data available (iir=04h) interrupt. d. the data ready bit (lsr bit 0) is set as soon as a character is transferred from the shift register to the rcvr fifo. it is reset when the fifo is empty. when rcvr fifo and receiver interrupts are enabled, rcvr fifo timeout interrupts occur as follows: a. a fifo timeout interrupt occurs if all the following conditions exist: ! at least one character is in the fifo ! the most recent serial character received was longer than 4 continuous character times ago. (if 2 stop bits are programmed, the second one is included in this time delay.) ! the most recent cpu read of the fifo was longer than 4 continuous character times ago. this will cause a maximum character received to interrupt issued delay of 160 msec at 300 baud with a 12 bit character. b. character times are calculated by using the rclk input for a clock signal (this makes the delay proportional to the baudrate). c. when a timeout interrupt has occurred it is cleared and the timer reset when the cpu reads one character from the rcvr fifo. d. when a timeout interrupt has not occurred the timeout timer is reset after a new character is received or after the cpu reads the rcvr fifo. when the xmit fifo and transmitter interrupts are enabled (fcr bit 0 = "1", ier bit 1 = "1"), xmit interrupts occur as follows: a. the transmitter holding register interrupt (02h) occurs when the xmit fifo is empty; it is cleared as soon as the transmitter holding register is written to (1 of 16 characters may be written to the xmit fifo while servicing this interrupt) or the iir is read. b. the transmitter fifo empty indications will be delayed 1 character time minus the last stop bit time whenever the following occurs: thre=1 and there have not been at least two bytes at the same time in the transmitter fifo since the last thre=1. the transmitter interrupt after changing fcr0 will be immediate, if it is enabled. character timeout and rcvr fifo trigger level interrupts have the same priority as the current received data available interrupt; xmit fifo empty has the same priority as the current transmitter holding register empty interrupt. fifo polled mode operation with fcr bit 0 = "1" resetting ier bits 0, 1, 2 or 3 or all to zero puts the uart in the fifo polled mode of operation. since the rcvr and xmitter are controlled separately, either one or both can be in the polled mode of operation.
smsc ds ? FDC37N958FR page 92 rev. 09/01/99 in this mode, the user's program will check rcvr and xmitter status via the lsr. lsr definitions for the fifo polled mode are as follows: ! bit 0=1 as long as there is one byte in the rcvr fifo. ! bits 1 to 4 specify which error(s) have occurred. character error status is handled the same way as when in the interrupt mode, the iir is not affected since eir bit 2=0. ! bit 5 indicates when the xmit fifo is empty. ! bit 6 indicates that both the xmit fifo and shift register are empty. ! bit 7 indicates whether there are any errors in the rcvr fifo. there is no trigger level reached or timeout condition indicated in the fifo polled mode, however, the rcvr and xmit fifos are still fully capable of holding characters. effect of the reset on register file the reset function table (table 40) details the effect of v cc 2 por or nreset_out on each of the registers of the serial port.
smsc ds ? FDC37N958FR page 93 rev. 09/01/99 table 40 - reset function table register/signal reset control reset state interrupt enable register reset all bits low interrupt identification reg. reset bit 0 is high; bits 1 - 7 low fifo control reset all bits low line control reg. reset all bits low modem control reg. reset all bits low line status reg. reset all bits low except 5, 6 high modem status reg. reset bits 0 - 3 low; bits 4 - 7 input txd1, txd2 reset high intrpt (rcvr errs) reset/read lsr low intrpt (rcvr data ready) reset/read rbr low intrpt (thre) reset/readiir/write thr low out2b reset high rtsb reset high dtrb reset high out1b reset high rcvr fifo reset/ fcr1*fcr0/_fcr0 all bits low xmit fifo reset/ fcr1*fcr0/_fcr0 all bits low
smsc ds ? FDC37N958FR page 94 rev. 09/01/99 table 41 - register summary for an individual uart channel register address* register name register symbol bit 0 bit 1 addr = 0 dlab = 0 receive buffer register (read only) rbr data bit 0 (note 1) data bit 1 addr = 0 dlab = 0 transmitter holding register (write only) thr data bit 0 data bit 1 addr = 1 dlab = 0 interrupt enable register ier enable received data available interrupt (erdai) enable transmitter holding register empty interrupt (ethrei) addr = 2 interrupt ident. register (read only) iir "0" if interrupt pending interrupt id bit addr = 2 fifo control register (write only) fcr fifo enable rcvr fifo reset addr = 3 line control register lcr word length select bit 0 (wls0) word length select bit 1 (wls1) addr = 4 modem control register mcr data terminal ready (dtr) request to send (rts) addr = 5 line status register lsr data ready (dr) overrun error (oe) addr = 6 modem status register msr delta clear to send (dcts) delta data set ready (ddsr) addr = 7 scratch register (note 4) scr bit 0 bit 1 addr = 0 dlab = 1 divisor latch (ls) ddl bit 0 bit 1 addr = 1 dlab = 1 divisor latch (ms) dlm bit 8 bit 9 *dlab is bit 7 of the line control register (addr = 3). note 1: bit 0 is the least significant bit. it is the first bit serially transmitted or received. note 2: when operating in the xt mode, this bit will be set any time that the transmitter shift register is empty.
smsc ds ? FDC37N958FR page 95 rev. 09/01/99 table 41 - register summary for an individual uart channel (continued) bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 data bit 2 data bit 3 data bit 4 data bit 5 data bit 6 data bit 7 data bit 2 data bit 3 data bit 4 data bit 5 data bit 6 data bit 7 enable receiver line status interrupt (elsi) enable modem status interrupt (emsi) 0 0 0 0 interrupt id bit interrupt id bit (note 5) 0 0 fifos enabled (note 5) fifos enabled (note 5) xmit fifo reset dma mode select (note 6) reserved reserved rcvr trigger lsb rcvr trigger msb number of stop bits (stb) parity enable (pen) even parity select (eps) stick parity set break divisor latch access bit (dlab) out1 (note 3) out2 (note 3) loop 0 0 0 parity error (pe) framing error (fe) break interrupt (bi) transmitter holding register (thre) transmitter empty (temt) (note 2) error in rcvr fifo (note 5) trailing edge ring indicator (teri) delta data carrier detect (ddcd) clear to send (cts) data set ready (dsr) ring indicator (ri) data carrier detect (dcd) bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 10 bit 11 bit 12 bit 13 bit 14 bit 15 note 3: this bit no longer has a pin associated with it. note 4: when operating in the xt mode, this register is not available. note 5: these bits are always zero in the non-fifo mode. note 6: writing a one to this bit has no effect. dma modes are not supported in this chip.
smsc ds ? FDC37N958FR page 96 rev. 09/01/99 uart register summary notes: *dlab is bit 7 of the line control register (addr = 3). note 1: bit 0 is the least significant bit. it is the first bit serially transmitted or received. note 2: when operating in the xt mode, this bit will be set any time that the transmitter shift register is empty. note 3: this bit no longer has a pin associated with it. note 4: when operating in the xt mode, this register is not available. note 5: these bits are always zero in the non-fifo mode. note 6: writing a one to this bit has no effect. dma modes are not supported in this chip. notes on serial port fifo mode operation general the rcvr fifo will hold up to 16 bytes regardless of which trigger level is selected. tx and rx fifo operation the tx portion of the uart transmits data through txd as soon as the cpu loads a byte into the tx fifo. the uart will prevent loads to the tx fifo if it currently holds 16 characters. loading to the tx fifo will again be enabled as soon as the next character is transferred to the tx shift register. these capabilities account for the largely autonomous operation of the tx. the uart starts the above operations typically with a tx interrupt. the chip issues a tx interrupt whenever the tx fifo is empty and the tx interrupt is enabled, except in the following instance. assume that the tx fifo is empty and the cpu starts to load it. when the first byte enters the fifo the tx fifo empty interrupt will transition from active to inactive. depending on the execution speed of the service routine software, the uart may be able to transfer this byte from the fifo to the shift register before the cpu loads another byte. if this happens, the tx fifo will be empty again and typically the uart's interrupt line would transition to the active state. this could cause a system with an interrupt control unit to record a tx fifo empty condition, even though the cpu is currently servicing that interrupt. therefore, after the first byte has been loaded into the fifo the uart will wait one serial character transmission time before issuing a new tx fifo empty interrupt. this one character tx interrupt delay will remain active until at least two bytes have been loaded into the fifo, concurrently. when the tx fifo empties after this condition, the tx interrupt will be activated without a one character delay. rx support functions and operation are quite different from those described for the transmitter. the rx fifo receives data until the number of bytes in the fifo equals the selected interrupt trigger level. at that time if rx interrupts are enabled, the uart will issue an interrupt to the cpu. the rx fifo will continue to store bytes until it holds 16 of them. it will not accept any more data when it is full. any more data entering the rx shift register will set the overrun error flag. normally, the fifo depth and the programmable trigger levels will give the cpu ample time to empty the rx fifo before an overrun occurs. one side-effect of having a rx fifo is that the selected interrupt trigger level may be above the data level in the fifo. this could occur when data at the end of the block contains fewer bytes than the trigger level. no interrupt would be issued to the cpu and the data would remain in the uart. to prevent the software from
smsc ds ? FDC37N958FR page 97 rev. 09/01/99 having to check for this situation the chip incorporates a timeout interrupt. the timeout interrupt is activated when there is a least one byte in the rx fifo, and neither the cpu nor the rx shift register has accessed the rx fifo within 4 character times of the last byte. the timeout interrupt is cleared or reset when the cpu reads the rx fifo or another character enters it. these fifo related features allow optimization of cpu/uart transactions and are especially useful given the higher baud rate capability (256 kbaud).
smsc ds ? FDC37N958FR page 98 rev. 09/01/99 infrared communications controller (ircc) the infrared communications controller is fully compliant to the irda specification version 1.1 which includes data rates up to 4 mbps to support irda-sira, irda-sirb, irda-hdlc and irda-fir modes. in addition the ircc provides support for ask-ir, consumer (tv remote) ir, and raw-ir (host controller has direct access to the ir bit stream from/to the transceiver module). it is important to note that the ircc block is a superset of uart2. thus the ircc comprises of a uart2 asynchronous communications engine (ace) and a separate synchronous communications engine (sce) to provide the full set of ir modes as well as the standard uart com mode. the ircc block details are fully described in smsc?s specification titled ?infrared communications controller?. the information in this section of the specification will provide details on the integration of the fir logic block into the FDC37N958FR. the infrared interface provides a two-way wireless communications port using infrared as a transmission medium. the ir transmission can use the standard uart2 tx and rx pins or optional irtx2 and irrx2 pins. these can be selected through the configuration registers. irda-sir allows serial communication at baud rates up to 115k baud. each word is sent serially beginning with a ?0? value start bit. a ?0? is signaled by sending a single ir pulse at the beginning of the serial bit time. a ?1? is signaled by sending no ir pulse during the bit time. please refer to the ac timing for the parameters of these pulses and the irda waveform. the amplitude shift keyed ir allows serial communication at baud rates up to 19.2k baud. each word is sent serially beginning with a ?0? value start bit. a ?0? is signaled by sending a 500 khz waveform for the duration of the serial bit time. a ?1? is signaled by sending no transmission the bit time. please refer to the ac timing for the parameters of the ask-ir waveform. if the half duplex option is chosen, there is a time- out when the direction of the transmission is changed. this time-out starts at the last bit transfered during a transmission and blocks the receiver input until the time-out expires. if the transmit buffer is loaded with more data before the time-out expires, the timer is restarted after the new byte is transmitted. if data is loaded into the transmit buffer while a character is being received, the transmission will not start until the time-out expires after the last receive bit has been received. if the start bit of another character is received during this time-out, the timer is restarted after the new character is received. the time-out is four character times. a character time is defined as 10 bit times regardless of the actual word length being used.
smsc ds ? FDC37N958FR page 99 rev. 09/01/99 figure 3 - integration of ircc logic into the FDC37N958FR hp_mode = (misc[14:13] == [1:0]) | (misc[16:15] == [1:0]) frx_sel = (misc[14:13] == [1:0]) irrx/irtx pin enable when misc2=0 the irrx and irtx pins are enabled as when uart2 (ld5) is activated or enabled and the ircc output mux is set to use the ir port, otherwise the irtx pin is tri-stated. when misc2=1, the irrx and irtx pins are always enabled as they can be bit banged through the ir data register, bits 1 and 0 respectively. gpio9 gpio8 irtx irrx gpio6 gpio10 gpio6_out gpio10_out gpio8_out gpio9_out tx rx tx rx tx rx gpio9_in ircc block raw tv ask irda fir com out mux com ir aux fast_bit g.p. data hp_mode fast misc7 1 misc[14:13] misc[16:15] frx_sel misc2 0 0 ir data reg bit-0 ir data reg bit-1 1 1 00 01 11 0 1 ncts2 ndtr2 ndsr2 ndcd2 nri2 gpio11 gpio12 gpio13 gpio14 gpio15 m u x misc[12] gpio[11-15] 1 0 0 0 1 1 0 nrts2 ?frx? ?ir_mode?
smsc ds ? FDC37N958FR page 100 rev. 09/01/99 ir registers - logical device 5 configuration registers overview in order to support the infared communications controller four configuration registers are added to logical device 5 (commonly known as uart2). these registers consist of the fast ir base i/o address registers 0x62 and 0x63; an ircc dma channel select register 0x74; and an ir half duplex timeout register 0xf2. refer to the configuration section of this specification for details. base i/o addresses 550 uart table 42 - asynchronous communications engine (uart) registers register index base i/o range fixed register base offsets 0x60, 0x61 [0x100:0x0ff8] on 8 byte boundaries +0 : rb/tb % lsb div +1 : ier % msb div +2 : iir/fcr +3 : lcr +4 : mcr +5 : lsr +6 : msr +7 : scr register 0x60 stores the msb and 0x61 the lsb of the 550-uart?s 16 bit base address.
smsc ds ? FDC37N958FR page 101 rev. 09/01/99 fast ir/usrt table 43 - synchronous communications engine (sce) registers register index base i/o range fixed register base offsets 0x62, 0x63 [0x100:0x0ff8] on 8 byte boundaries +0 : register block n, address 0 +1 : register block n, address 1 +2 : register block n, address 2 +3 : register block n, address 3 +4 : register block n, address 4 +5 : register block n, address 5 +6 : register block n, address 6 +7 : usrt master control register register 0x60 stores the msb and 0x61 the lsb of the 550-uart?s 16 bit base address. note: refer to the infrared communications controller (ircc) specification for register details note: if base i/o address is set below 0x100 then no decode will occur. ir dma channels dma channel 0, 1, 2 or 3 may be selected for use with the ircc logic through the configuration registers of logical device 5. refer to the configuation section of this specification for further details on setting the dma channel and to the ircc specificaton for details on ir dma transfers. ir irqs the interrupt (irq) for the ircc logic is selectable through the configuration registers for logical device 5. refer to the configuation section of this specification for further details on setting the irq and to the ircc specificaton for details on ir irq events.
smsc ds ? FDC37N958FR page 102 rev. 09/01/99 parallel port the FDC37N958FR incorporates an ibm xt/at compatible parallel port. this supports the optional ps/2 type bi-directional parallel port (spp), the enhanced parallel port (epp) and the extended capabilities port (ecp) parallel port modes. refer to the configuration registers for information on disabling, power down, changing the base address of the parallel port, and selecting the mode of operation. the parallel port also incorporates smsc's chiprotect circuitry, which prevents possible damage to the parallel port due to printer power- up. the functionality of the parallel port is achieved through the use of eight addressable ports, with their associated registers and control gating. the control and data port are read/write by the cpu, the status port is read/write in the epp mode. the address map of the parallel port is shown below: address map for parallel port register name address data port base address + 00h status port base address + 01h control port base address + 02h epp addr port base address + 03h epp data port 0 base address + 04h epp data port 1 base address + 05h epp data port 2 base address + 06h epp data port 3 base address + 07h the bit map of these registers is: d0 d1 d2 d3 d4 d5 d6 d7 note data port pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 1 status port tmout 0 0 nerr slct pe nack nbusy 1 control port strobe autofd ninit slc irqe pcd 0 0 1 epp addr port pd0 pd1 pd2 pd3 pd4 pd5 pd6 ad7 2,3 epp data port 0 pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 2,3 epp data port 1 pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 2,3 epp data port 2 pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 2,3 epp data port 3 pd0 pd1 pd2 pd3 pd4 pd5 pd6 pd7 2,3 note 1: these registers are available in all modes. note 2: these registers are only available in epp mode. note 3: for epp mode, iochrdy must be connected to the isa bus.
smsc ds ? FDC37N958FR page 103 rev. 09/01/99 table 44 - parallel port connector host connector pin number standard epp ecp 1 129 nstrobe nwrite nstrobe 2-9 124-121, 119-116 pdata<0:7> pdata<0:7> pdata<0:7> 10 115 nack intr nack 11 114 busy nwait busy, periphack(3) 12 113 pe (nu) perror, nackreverse(3) 13 112 select (nu) select 14 128 nautofd ndatastb nautofd, hostack(3) 15 127 nerror (nu) nfault(1) nperiphrequest(3) 16 126 ninit (nu) ninit(1) nreverserqst(3) 17 125 nselectin naddrstrb nselectin(1,3) (1) = compatible mode (3) = high speed mode note: for the cable interconnection required for ecp support and the slave connector pin numbers, refer to the ieee p1284 d2.0 standard, ?standard signaling method for a bi-directional parallel peripheral interface for personal computers?, september 10, 1993. this document is available from the ieee. ibm xt/at compatible, bi-directional and epp modes data port address offset = 00h the data port is located at an offset of '00h' from the base address. the data register is cleared at nitialization by reset. during a write operation, the data register latches the contents of the data bus with the rising edge of the niow input. the contents of this register are buffered (non inverting) and output onto the pd0-pd7 ports. during a read operation in spp mode, pd0-pd7 ports are buffered (not latched) and output to the host cpu.
smsc ds ? FDC37N958FR page 104 rev. 09/01/99 status port address offset = 01h the status port is located at an offset of '01h' from the base address. the contents of this register are latched for the duration of an nior read cycle. the bits of the status port are defined as follows: bit 0 tmout - time out this bit is valid in epp mode only and indicates that a 10 usec time out has occured on the epp bus. a logic ?0? means that no time out error has occured; a logic ?1? means that a time out error has been detected. this bit is cleared by a reset. writing a one to this bit clears the time out status bit. on a write, this bit is self clearing and does not require a write of a ?0?. writing a ?0? to this bit has no effect. bits 1, 2 - are not implemented as register bits, during a read of the printer status register these bits are a low level. bit 3 nerr - nerror the level on the nerror input is read by the cpu as bit 3 of the printer status register. a logic 0 means an error has been detected; a logic ?1? means no error has been detected. bit 4 slct - printer selected status the level on the slct input is read by the cpu as bit 4 of the printer status register. a logic ?1? means the printer is on line; a logic 0 means it is not selected. bit 5 pe - paper end the level on the pe input is read by the cpu as bit 5 of the printer status register. a logic ?1? indicates a paper end; a logic 0 indicates the presence of paper. bit 6 nack - nacknowledge the level on the nack input is read by the cpu as bit 6 of the printer status register. a logic ?0? means that the printer has received a character and can now accept another. a logic ?1? means that it is still processing the last character or has not received the data. bit 7 nbusy - nbusy the complement of the level on the busy input is read by the cpu as bit 7 of the printer status register. a logic ?0? in this bit means that the printer is busy and cannot accept a new character. a logic ?1? means that it is ready to accept the next character. control port address offset = 02h the control port is located at an offset of '02h' from the base address. the control register is initialized by the reset input, bits 0 to 5 only being affected; bits 6 and 7 are hard wired low. bit 0 strobe - strobe this bit is inverted and output onto the nstrobe output. bit 1 autofd - autofeed this bit is inverted and output onto the nautofd output. a logic ?1? causes the printer to generate a line feed after each line is printed. a logic ?0? means no autofeed. bit 2 ninit - ninitiate output this bit is output onto the ninit output without inversion. bit 3 slctin - printer select input this bit is inverted and output onto the nslctin output. a logic ?1? on this bit selects the printer; a logic ?0? means the printer is not selected. bit 4 irqe - interrupt request enable the interrupt request enable bit when set to a high level may be used to enable interrupt requests from the parallel port to the cpu. an interrupt request is generated on the irq port by a positive going nack input. when the irqe bit is programmed low the irq is disabled.
smsc ds ? FDC37N958FR page 105 rev. 09/01/99 bit 5 pcd - parallel control direction parallel control direction is not valid in printer mode. in printer mode, the direction is always out regardless of the state of this bit. in bi-directional, epp or ecp mode, a logic 0 means that the printer port is in output mode (write); a logic ?1? means that the printer port is in input mode (read). bits 6 and 7 during a read are a low level, and cannot be written. epp address port address offset = 03h the epp address port is located at an offset of '03h' from the base address. the address register is cleared at initialization by reset. during a write operation, the contents of db0- db7 are buffered (non inverting) and output onto the pd0 - pd7 ports, the leading edge of niow causes an epp address write cycle to be performed, the trailing edge of iow latches the data for the duration of the epp write cycle. during a read operation, pd0-pd7 ports are read, the leading edge of ior causes an epp address read cycle to be performed and the data output to the host cpu, the deassertion of addrstb latches the pdata for the duration of the ior cycle. this register is only available in epp mode. epp data port 0 address offset = 04h the epp data port 0 is located at an offset of '04h' from the base address. the data register is cleared at initialization by reset. during a write operation, the contents of db0-db7 are buffered (non inverting) and output onto the pd0-pd7 ports, the leading edge of niow causes an epp data write cycle to be performed, the trailing edge of iow latches the data for the duration of the epp write cycle. during a read operation, pd0 - pd7 ports are read, the leading edge of ior causes an epp read cycle to be performed and the data output to the host cpu, the deassertion of datastb latches the pdata for the duration of the ior cycle. this register is only available in epp mode. epp data port 1 address offset = 05h the epp data port 1 is located at an offset of '05h' from the base address. refer to epp data port 0 for a description of operation. this register is only available in epp mode. epp data port 2 address offset = 06h the epp data port 2 is located at an offset of '06h' from the base address. refer to epp data port 0 for a description of operation. this register is only available in epp mode. epp data port 3 address offset = 07h the epp data port 3 is located at an offset of '07h' from the base address. refer to epp data port 0 for a description of operation. this register is only available in epp mode.
smsc ds ? FDC37N958FR page 106 rev. 09/01/99 epp 1.9 operation when the epp mode is selected in the configuration register, the standard and bi- directional modes are also available. if no epp read, write or address cycle is currently executing, then the pdx bus is in the standard or bi-directional mode, and all output signals (strobe, autofd, init) are as set by the spp control port and direction is controlled by pcd of the control port. in epp mode, the system timing is closely coupled to the epp timing. for this reason, a watchdog timer is required to prevent system lockup. the timer indicates if more than 10usec have elapsed from the start of the epp cycle (nior or niow asserted) to nwait being deasserted (after command). if a time-out occurs, the current epp cycle is aborted and the time-out condition is indicated in status bit 0. during an epp cycle, if strobe is active, it overrides the epp write signal forcing the pdx bus to always be in a write mode and the nwrite signal to always be asserted. software constraints before an epp cycle is executed, the software must ensure that the control register bit pcd is a logic "0" (i.e. a 04h or 05h should be written to the control port). if the user leaves pcd as a logic "1", and attempts to perform an epp write, the chip is unable to perform the write (because pcd is a logic "1") and will appear to perform an epp read on the parallel bus, no error is indicated. epp 1.9 write the timing for a write operation (address or data) is shown in timing diagram epp write data or address cycle. iochrdy is driven active low at the start of each epp write and is released when it has been determined that the write cycle can complete. the write cycle can complete under the following circumstances: 1. if the epp bus is not ready (nwait is active low) when ndatastb or naddrstb goes active then the write can complete when nwait goes inactive high. 2. if the epp bus is ready (nwait is inactive high) then the chip must wait for it to go active low before changing the state of ndatastb, nwrite or naddrstb. the write can complete once nwait is determined inactive. write sequence of operation 1. the host selects an epp register, places data on the sdata bus and drives niow active. 2. the chip drives iochrdy inactive (low). 3. if wait is not asserted, the chip must wait until wait is asserted. 4. the chip places address or data on pdata bus, clears pdir, and asserts nwrite. 5. chip asserts ndatastb or naddrstrb indicating that pdata bus contains valid information, and the write signal is valid. 6. peripheral deasserts nwait, indicating that any setup requirements have been satisfied and the chip may begin the termination phase of the cycle. 7. a) the chip deasserts ndatastb or naddrstrb, this marks the beginning of the termination phase. if it has not already done so, the peripheral should latch the information byte now. b) the chip latches the data from the sdata bus for the pdata bus and asserts (releases) iochrdy allowing the host to complete the write cycle. 8. peripheral asserts nwait, indicating to the host that any hold time requirements have been satisfied and acknowledging the termination of the cycle. 9. chip may modify nwrite and npdata in preparation for the next cycle.
smsc ds ? FDC37N958FR page 107 rev. 09/01/99 epp 1.9 read the timing for a read operation (data) is shown in timing diagram epp read data cycle. iochrdy is driven active low at the start of each epp read and is released when it has been determined that the read cycle can complete. the read cycle can complete under the following circumstances: 1. if the epp bus is not ready (nwait is active low) when ndatastb goes active then the read can complete when nwait goes inactive high. 2. if the epp bus is ready (nwait is inactive high) then the chip must wait for it to go active low before changing the state of write or before ndatastb goes active. the read can complete once nwait is determined inactive. read sequence of operation 1. the host selects an epp register and drives nior active. 2. the chip drives iochrdy inactive (low). 3. if wait is not asserted, the chip must wait until wait is asserted. 4. the chip tri-states the pdata bus and deasserts nwrite. 5. chip asserts ndatastb or naddrstrb indicating that pdata bus is tri-stated, pdir is set and the nwrite signal is valid. 6. peripheral drives pdata bus valid. 7. peripheral deasserts nwait, indicating that pdata is valid and the chip may begin the termination phase of the cycle. 8. a) the chip latches the data from the pdata bus for the sdata bus and deasserts ndatastb or naddrstrb. this marks the beginning of the termination phase. b) the chip drives the valid data onto the sdata bus and asserts (releases) iochrdy allowing the host to complete the read cycle. 9. peripheral tri-states the pdata bus and asserts nwait, indicating to the host that the pdata bus is tri-stated. 10. chip may modify nwrite, pdir and npdata in preparation for the next cycle. epp 1.7 operation when the epp 1.7 mode is selected in the configuration register, the standard and bi- directional modes are also available. if no epp read, write or address cycle is currently executing, then the pdx bus is in the standard or bi-directional mode, and all output signals (strobe, autofd, init) are as set by the spp control port and direction is controlled by pcd of the control port. in epp mode, the system timing is closely coupled to the epp timing. for this reason, a watchdog timer is required to prevent system lockup. the timer indicates if more than 10usec have elapsed from the start of the epp cycle (nior or niow asserted) to the end of the cycle nior or niow deasserted). if a time-out occurs, the current epp cycle is aborted and the time-out condition is indicated in status bit 0.
smsc ds ? FDC37N958FR page 108 rev. 09/01/99 software constraints before an epp cycle is executed, the software must ensure that the control register bits d0, d1 and d3 are set to zero. also, bit d5 (pcd) is a logic "0" for an epp write or a logic "1" for and epp read. epp 1.7 write the timing for a write operation (address or data) is shown in timing diagram epp 1.7 write data or address cycle. iochrdy is driven active low when nwait is active low during the epp cycle. this can be used to extend the cycle time. the write cycle can complete when nwait is inactive high. write sequence of operation 1. the host sets pdir bit in the control register to a logic "0". this asserts nwrite. 2. the host selects an epp register, places data on the sdata bus and drives niow active. 3. the chip places address or data on pdata bus. 4. chip asserts ndatastb or naddrstrb indicating that pdata bus contains valid information, and the write signal is valid. 5. if nwait is asserted, iochrdy is deasserted until the peripheral deasserts nwait or a time-out occurs. 6. when the host deasserts niow the chip deasserts ndatastb or naddrstrb and latches the data from the sdata bus for the pdata bus. 7. chip may modify nwrite, pdir and npdata in preparation of the next cycle. epp 1.7 read the timing for a read operation (data) is shown in timing diagram epp 1.7 read data cycle. iochrdy is driven active low when nwait is active low during the epp cycle. this can be used to extend the cycle time. the read cycle can complete when nwait is inactive high. read sequence of operation 1. the host sets pdir bit in the control register to a logic "1". this deasserts nwrite and tri-states the pdata bus. 2. the host selects an epp register and drives nior active. 3. chip asserts ndatastb or naddrstrb indicating that pdata bus is tri-stated, pdir is set and the nwrite signal is valid. 4. if nwait is asserted, iochrdy is deasserted until the peripheral deasserts nwait or a time-out occurs. 5. the peripheral drives pdata bus valid. 6. the peripheral deasserts nwait, indicating that pdata is valid and the chip may begin the termination phase of the cycle. 7. when the host deasserts nior the chip deasserts ndatastb or naddrstrb. 8. peripheral tri-states the pdata bus. 9. chip may modify nwrite, pdir and npdata reparation of the next cycle.
smsc ds ? FDC37N958FR page 109 rev. 09/01/99 table 45 - epp pin descriptions epp signal epp name type epp description nwrite nwrite o this signal is active low. it denotes a write operation. pd<0:7> address/data i/o bi-directional epp byte wide address and data bus. intr interrupt i this signal is active high and positive edge triggered. (pass through with no inversion, same as spp.) wait nwait i this signal is active low. it is driven inactive as a positive acknowledgement from the device that the transfer of data is completed. it is driven active as an indication that the device is ready for the next transfer. datastb ndata strobe o this signal is active low. it is used to denote data read or write operation. reset nreset o this signal is active low. when driven active, the epp device is reset to its initial operational mode. addrstb naddress strobe o this signal is active low. it is used to denote address read or write operation. pe paper end i same as spp mode. slct printer selected status i same as spp mode. nerr error i same as spp mode. pdir parallel port direction o this output shows the direction of the data transfer on the parallel port bus. a low means an output/write condition and a high means an input/read condition. this signal is normally a low (output/write) unless pcd of the control register is set or if an epp read cycle is in progress. note 1: spp and epp can use 1 common register. note 2: nwrite is the only epp output that can be over-ridden by spp control port during an epp cycle. for correct epp read cycles, pcd is required to be a low.
smsc ds ? FDC37N958FR page 110 rev. 09/01/99 extended capabilities parallel port ecp provides a number of advantages, some of which are listed below. the individual features are explained in greater detail in the remainder of this section. ! high performance half-duplex forward and reverse channel ! interlocked handshake, for fast reliable transfer ! optional single byte rle compression for improved throughput (64:1) ! channel addressing for low-cost peripherals ! maintains link and data layer separation ! permits the use of active output drivers ! permits the use of adaptive signal timing ! peer-to-peer capability vocabulary the following terms are used in this document: assert: when a signal asserts it transitions to a "true" state, when a signal deasserts it transitions to a "false" state. forward: host to peripheral communication. reverse: peripheral to host communication. pword: a port word; equal in size to the width of the isa interface. for this implementation, pword is always 8 bits. 1: a high level. 0: a low level.
smsc ds ? FDC37N958FR page 111 rev. 09/01/99 these terms may be considered synonymous: ! periphclk, nack ! hostack, nautofd ! periphack, busy ! nperiphrequest, nfault ! nreverserequest, ninit ! nackreverse, perror ! xflag, select ! ecpmode, nselectln ! hostclk, nstrobe reference document ieee 1284 extended capabilities port protocol and isa interface standard, rev 1.14, july 14, 1993. this document is available from microsoft. the bit map of the extended parallel port registers is: d7 d6 d5 d4 d3 d2 d1 d0 note data pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0 ecpafifo addr/rle address or rle field 2 dsr nbusy nack perror select nfault 0 0 0 1 dcr 0 0 direction ackinten selectin ninit autofd strobe 1 cfifo parallel port data fifo 2 ecpdfifo ecp data fifo 2 tfifo test fifo 2 cnfga 0 0 0 1 0 0 0 0 cnfgb compress intrvalue 0 0 0 0 0 0 ecr mode nerrintren dmaen serviceintr full empty note 1: these registers are available in all modes. note 2: all fifos use one common 16 byte fifo.
smsc ds ? FDC37N958FR page 112 rev. 09/01/99 isa implementation standard this specification describes the standard isa interface to the extended capabilities port (ecp). all isa devices supporting ecp must meet the requirements contained in this section or the port will not be supported by microsoft. for a description of the ecp protocol, please refer to the ieee 1284 extended capabilities port protocol and isa interface standard, rev. 1.14, july 14, 1993. this document is available from microsoft. description the port is software and hardware compatible with existing parallel ports so that it may be used as a standard lpt port if ecp is not required. the port is designed to be simple and requires a small number of gates to implement. it does not do any "protocol" negotiation, rather it provides an automatic high burst-bandwidth channel that supports dma for ecp in both the forward and reverse directions. small fifos are employed in both forward and reverse directions to smooth data flow and improve the maximum bandwidth requirement. the size of the fifo is 16 bytes deep. the port supports an automatic handshake for the standard parallel port to improve compatibility mode transfer speed. the port also supports run length encoded (rle) decompression (required) in hardware. compression is accomplished by counting identical bytes and transmitting an rle byte that indicates how many times the next byte is to be repeated. decompression simply intercepts the rle byte and repeats the following byte the specified number of times. hardware support for compression is optional.
smsc ds ? FDC37N958FR page 113 rev. 09/01/99 table 46 - ecp pin descriptions name type description nstrobe o during write operations nstrobe registers data or address into the slave on the asserting edge (handshakes with busy). pdata 7:0 i/o contains address or data or rle data. nack i indicates valid data driven by the peripheral when asserted. this signal handshakes with nautofd in reverse. periphack (busy) i this signal deasserts to indicate that the peripheral can accept data. this signal handshakes with nstrobe in the forward direction. in the reverse direction this signal indicates whether the data lines contain ecp command information or data. the peripheral uses this signal to flow control in the forward direction. it is an "interlocked" handshake with nstrobe. periphack also provides command information in the reverse direction. perror (nackreverse) i used to acknowledge a change in the direction the transfer (asserted = forward). the peripheral drives this signal low to acknowledge nreverserequest. it is an "interlocked" handshake with nreverserequest. the host relies upon nackreverse to determine when it is permitted to drive the data bus. select i indicates printer on line. nautofd (hostack) o requests a byte of data from the peripheral when asserted, handshaking with nack in the reverse direction. in the forward direction this signal indicates whether the data lines contain ecp address or data. the host drives this signal to flow control in the reverse direction. it is an "interlocked" handshake with nack. hostack also provides command information in the forward phase. nfault (nperiphrequest) i generates an error interrupt when asserted. this signal provides a mechanism for peer-to-peer communication. this signal is valid only in the forward direction. during ecp mode the peripheral is permitted (but not required) to drive this pin low to request a reverse transfer. the request is merely a "hint" to the host; the host has ultimate control over the transfer direction. this signal would be typically used to generate an interrupt to the host cpu. ninit o sets the transfer direction (asserted = reverse, deasserted = forward). this pin is driven low to place the channel in the reverse direction. the peripheral is only allowed to drive the bi-directional data bus while in ecp mode and hostack is low and nselectin is high. nselectin o always deasserted in ecp mode.
smsc ds ? FDC37N958FR page 114 rev. 09/01/99 register definitions the register definitions are based on the standard ibm addresses for lpt. all of the standard printer ports are supported. the additional registers attach to an upper bit decode of the standard lpt port definition to avoid conflict with standard isa devices. the port is equivalent to a generic parallel port interface and may be operated in that mode. the port registers vary depending on the mode field in the ecr. the table below lists these dependencies. operation of the devices in modes other that those specified is undefined. table 47 - ecp register definitions name address (note 1) ecp modes function data +000h r/w 000-001 data register ecpafifo +000h r/w 011 ecp fifo (address) dsr +001h r/w all status register dcr +002h r/w all control register cfifo +400h r/w 010 parallel port data fifo ecpdfifo +400h r/w 011 ecp fifo (data) tfifo +400h r/w 110 test fifo cnfga +400h r 111 configuration register a cnfgb +401h r/w 111 configuration register b ecr +402h r/w all extended control register note 1: these addresses are added to the parallel port base address as selected by configuration register or jumpers. note 2: all addresses are qualified with aen. refer to the aen pin definition.
smsc ds ? FDC37N958FR page 115 rev. 09/01/99 table 48 - mode descriptions mode description* 000 spp mode 001 ps/2 parallel port mde 010 parallel port data fifo mode 011 ecp parallel port mode 100 epp mode (if this option is enabled in the configuration registers) 101 (reserved) 110 test mode 111 configuration mode *refer to ecr register description data and ecpafifo port address offset = 00h modes 000 and 001 (data port) the data port is located at an offset of '00h' from the base address. the data register is cleared at initialization by reset. during a write operation, the data register latches the contents of the data bus on the rising edge of the niow input. the contents of this register are buffered (non inverting) and output onto the pd0 - pd7 ports. during a read operation, pd0 - pd7 ports are read and output to the host cpu. mode 011 (ecp fifo - address/rle) a data byte written to this address is placed in the fifo and tagged as an ecp address/rle. the hardware at the ecp port transmitts this byte to the peripheral automatically. the operation of this register is ony defined for the forward direction (direction is 0). refer to the ecp parallel port forward timing diagram, located in the timing diagrams section of this data sheet. device status register (dsr) address offset = 01h the status port is located at an offset of '01h' from the base address. bits 0-2 are not implemented as register bits, during a read of the printer status register these bits are a low level. the bits of the status port are defined as follows: bit 3 nfault the level on the nfault input is read by the cpu as bit 3 of the device status register. bit 4 select the level on the select input is read by the cpu as bit 4 of the device status register. bit 5 perror the level on the perror input is read by the cpu as bit 5 of the device status register. printer status register. bit 6 nack the level on the nack input is read by the cpu as bit 6 of the device status register. bit 7 nbusy the complement of the level on the busy input is read by the cpu as bit 7 of the device status register.
smsc ds ? FDC37N958FR page 116 rev. 09/01/99 device control register (dcr) address offset = 02h the control register is located at an offset of '02h' from the base address. the control register is initialized to zero by the reset input, bits 0 to 5 only being affected; bits 6 and 7 are hard wired low. bit 0 strobe - strobe this bit is inverted and output onto the nstrobe output. bit 1 autofd - autofeed this bit is inverted and output onto the nautofd output. a logic ?1? causes the printer to generate a line feed after each line is printed. a logic ?0? means no autofeed. bit 2 ninit - ninitiate output this bit is output onto the ninit output without inversion. bit 3 selectin this bit is inverted and output onto the nslctin output. a logic ?1? on this bit selects the printer; a logic ?0? means the printer is not selected. bit 4 ackinten - interrupt request enable the interrupt request enable bit when set to a high level may be used to enable interrupt requests from the parallel port to the cpu due to a low to high transition on the nack input. refer to the description of the interrupt under operation, interrupts. bit 5 direction if mode=000 or mode=010, this bit has no effect and the direction is always out regardless of the state of this bit. in all other modes, direction is valid and a logic 0 means that the printer port is in output mode (write); a logic ?1? means that the printer port is in input mode (read). bits 6 and 7 during a read are a low level, and cannot be written. cfifo (parallel port data fifo) address offset = 400h mode = 010 bytes written or dmaed from the system to this fifo are transmitted by a hardware handshake to the peripheral using the standard parallel port protocol. transfers to the fifo are byte aligned. this mode is only defined for the forward direction. ecpdfifo (ecp data fifo) address offset = 400h mode = 011 bytes written or dmaed from the system to this fifo, when the direction bit is ?0?, are transmitted by a hardware handshake to the peripheral using the ecp parallel port protocol. transfers to the fifo are byte aligned. data bytes from the peripheral are read under automatic hardware handshake from ecp into this fifo when the direction bit is ?1?. reads or dmas from the fifo will return bytes of ecp data to the system. tfifo (test fifo mode) address offset = 400h mode = 110 data bytes may be read, written or dmaed to or from the system to this fifo in any direction. data in the tfifo will not be transmitted to the to the parallel port lines using a hardware protocol handshake. however, data in the tfifo may be displayed on the parallel port data lines. the tfifo will not stall when overwritten or underrun. if an attempt is made to write data to a full tfifo, the new data is not accepted into the tfifo. if an attempt is made to read data from an empty tfifo, the last data byte is re-read again. the full and empty bits must always keep track of the correct fifo state. the tfifo will transfer
smsc ds ? FDC37N958FR page 117 rev. 09/01/99 data at the maximum isa rate so that software may generate performance metrics. the fifo size and interrupt threshold can be determined by writing bytes to the fifo and checking the full and serviceintr bits. the writeintrthreshold can be derermined by starting with a full tfifo, setting the direction bit to ?0? and emptying it a byte at a time until serviceintr is set. this may generate a spurious interrupt, but will indicate that the threshold has been reached. the readintrthreshold can be derermined by setting the direction bit to ?1? and filling the empty tfifo a byte at a time until serviceintr is set. this may generate a spurious interrupt, but will indicate that the threshold has been reached. data bytes are always read from the head of tfifo regardless of the value of the direction bit. for example if 44h, 33h, 22h is written to the fifo, then reading the tfifo will return 44h, 33h, 22h in the same order as was written. cnfga (configuration register a) address offset = 400h mode = 111 this register is a read only register. when read, 10h is returned. this indicates to the system that this is an 8-bit implementation. (pword = 1 byte) cnfgb (configuration register b) address offset = 401h mode = 111 bit 7 compress this bit is read only. during a read it is a low level. this means that this chip does not support hardware rle compression. it does support hardware de-compression! bit 6 intrvalue returns the value on the isa irq line to determine possible conflicts. bits 5:0 reserved during a read are a low level. these bits cannot be written. ecr (extended control register) address offset = 402h mode = all this register controls the extended ecp parallel port functions. bits 7 - 5 these bits are read/write and select the mode. bit 4 nerrintren read/write (valid only in ecp mode) 1: disables the interrupt generated on the asserting edge of nfault. 0: enables an interrupt pulse on the high to low edge of nfault. note that an interrupt will be generated if nfault is asserted (interrupting) and this bit is written from a 1 to a 0. this prevents interrupts from being lost in the time between the read of the ecr and the write of the ecr. bit 3 dmaen read/write 1: enables dma (dma starts when serviceintr is 0). 0: disables dma unconditionally. bit 2 serviceintr read/write 1: disables dma and all of the service interrupts. 0: enables one of the following 3 cases of interrupts. once one of the 3 service interrupts has occurred serviceintr bit shall be set to a 1 by hardware. it must be reset to 0 to re-enable the interrupts. writing this bit to a 1 will not cause an interrupt. case dmaen=1: during dma (this bit is set to a ?1? when terminal count is reached). case dmaen=0 direction=0:
smsc ds ? FDC37N958FR page 118 rev. 09/01/99 this bit shall be set to 1 whenever there are writeintrthreshold or more bytes free in the fifo. case dmaen=0 direction=1: this bit shall be set to 1 whenever there are readintrthreshold or more valid bytes to be read from the fifo. bit 1 full read only 1: the fifo cannot accept another byte or the fifo is completely full. 0: the fifo has at least 1 free byte. bit 0 empty read only 1: the fifo is completely empty. 0: the fifo contains at least 1 byte of data. table 49 - extended control register r/w mode 000: standard parallel port mode . in this mode the fifo is reset and common collector drivers are used on the control lines (nstrobe, nautofd, ninit and nselectin). setting the direction bit will not tri-state the output drivers in this mode. 001: ps/2 parallel port mode. same as above except that direction may be used to tri-state the data lines and reading the data register returns the value on the data lines and not the value in the data register. all drivers have active pull-ups (push-pull). 010: parallel port fifo mode. this is the same as 000 except that bytes are written or dmaed to the fifo. fifo data is automatically transmitted using the standard parallel port protocol. note that this mode is only useful when direction is 0. all drivers have active pull-ups (push-pull). 011: ecp parallel port mode. in the forward direction (direction is 0) bytes placed into the ecpdfifo and bytes written to the ecpafifo are placed in a single fifo and transmitted automatically to the peripheral using ecp protocol. in the reverse direction (direction is 1) bytes are moved from the ecp parallel port and packed into bytes in the ecpdfifo. all drivers have active pull-ups (push-pull). 100: selects epp mode: in this mode, epp is selected if the epp supported option is selected in configuration register l3-crf0. all drivers have active pull-ups (push-pull). 101: reserved 110: test mode. in this mode the fifo may be written and read, but the data will not be transmitted on the parallel port. all drivers have active pull-ups (push-pull). 111: configuration mode. in this mode the confga, confgb registers are accessible at 0x400 and 0x401. all drivers have active pull-ups (push-pull).
smsc ds ? FDC37N958FR page 119 rev. 09/01/99 operation mode switching/software control software will execute p1284 negotiation and all operation prior to a data transfer phase under programmed i/o control (mode 000 or 001). hardware provides an automatic control line handshake, moving data between the fifo and the ecp port only in the data transfer phase (modes 011 or 010). setting the mode to 011 or 010 will cause the hardware to initiate data transfer. if the port is in mode 000 or 001 it may switch to any other mode. if the port is not in mode 000 or 001 it can only be switched into mode 000 or 001. the direction can only be changed in mode 001. once in an extended forward mode the software should wait for the fifo to be empty before switching back to mode 000 or 001. in this case all control signals will be deasserted before the mode switch. in an ecp reverse mode the software waits for all the data to be read from the fifo before changing back to mode 000 or 001. since the automatic hardware ecp reverse handshake only cares about the state of the fifo it may have acquired extra data which will be discarded. it may in fact be in the middle of a transfer when the mode is changed back to 000 or 001. in this case the port will deassert nautofd independent of the state of the transfer. the design shall not cause glitches on the handshake signals if the software meets the constraints above. ecp operation prior to ecp operation the host must negotiate on the parallel port to determine if the peripheral supports the ecp protocol. this is a somewhat complex negotiation carried out under program control in mode 000. after negotiation, it is necessary to initialize some of the port bits. the following are required: ! set direction = 0, enabling the drivers. ! set strobe = 0, causing the nstrobe signal to default to the deasserted state. ! set autofd = 0, causing the nautofd signal to default to the deasserted state. ! set mode = 011 (ecp mode) ecp address/rle bytes or data bytes may be sent automatically by writing the ecpafifo or ecpdfifo respectively. note that all fifo data transfers are byte wide and byte aligned. address/rle transfers are byte-wide and only allowed in the forward direction. the host may switch directions by first switching to mode = 001, negotiating for the forward or reverse channel, setting direction to ?1? or ?0?, then setting mode = 011. when direction is 1 the hardware shall handshake for each ecp read data byte and attempt to fill the fifo. bytes may then be read from the ecpdfifo as long as it is not empty. ecp transfers may also be accomplished (albeit slowly) by handshaking individual bytes under program control in mode = 001, or 000. termination from ecp mode termination from ecp mode is similar to the termination from nibble/byte modes. the host is permitted to terminate from ecp mode only in specific well-defined states. the termination can only be executed while the bus is in the forward direction. to terminate while the channel is in the reverse direction, it must first be transitioned into the forward direction.
smsc ds ? FDC37N958FR page 120 rev. 09/01/99 command/data ecp mode supports two advanced features to improve the effectiveness of the protocol for some applications. the features are implemented by allowing the transfer of normal 8 bit data or 8 bit commands. when in the forward direction, normal data is transferred when hostack is high and an 8 bit command is transferred when hostack is low. the most significant bit of the command indicates whether it is a run-length count (for compression) or a channel address. when in the reverse direction, normal data is transferred when periphack is high and an 8 bit command is transferred when periphack is low. the most significant bit of the command is always ?0?. reverse channel addresses are seldom used and may not be supported in hardware table 50 - forward channel commands (hostack low) & reverse channel commands (peripack low) d7 d[6:0] 0 run-length count (0-127) (mode 0011 0x00 only) 1 channel address (0-127)
smsc ds ? FDC37N958FR page 121 rev. 09/01/99 data compression the ecp port supports run length encoded (rle) decompression in hardware and can transfer compressed data to a peripheral. run length encoded (rle) compression in hardware is not supported. to transfer compressed data in ecp mode, the compression count is written to the ecpafifo and the data byte is written to the ecpdfifo. compression is accomplished by counting identical bytes and transmitting an rle byte that indicates how many times the next byte is to be repeated. decompression simply intercepts the rle byte and repeats the following byte the specified number of times. when a run-length count is received from a peripheral, the subsequent data byte is replicated the specified number of times. a run-length count of zero specifies that only one byte of data is represented by the next data byte, whereas a run-length count of 127 indicates that the next byte should be expanded to 128 bytes. to prevent data expansion, however, run-length counts of zero should be avoided. pin definition the drivers for nstrobe, nautofd, ninit and nselectin are open-collector in mode 000 and are push-pull in all other modes. isa connections the interface can never stall causing the host to hang. the width of data transfers is strictly controlled on an i/o address basis per this specification. all fifo-dma transfers are byte wide, byte aligned and end on a byte boundary. (the pword value can be obtained by reading configuration register a, cnfga, described in the next section.) single byte wide transfers are always possible with standard or ps/2 mode using program control of the control signals. interrupts the interrupts are enabled by serviceintr in the ecr register. serviceintr = 1 disables the dma and all of the service interrupts. serviceintr = 0 enables the selected interrupt condition. if the interrupting condition is valid, then the interrupt is generated immediately when this bit is changed from a 1 to a 0. this can occur during programmed i/o if the number of bytes removed or added from/to the fifo does not cross the threshold. the interrupt generated is isa friendly in that it must pulse the interrupt line low, allowing for interrupt sharing. after a brief pulse low following the interrupt event, the interrupt line is tri-stated so that other interrupts may assert. an interrupt is generated when: 1. for dma transfers: when serviceintr is ?0?, dmaen is 1 and the dma tc is received. 2. for programmed i/o: a. when serviceintr is 0, dmaen is 0, direction is ?0? and there are writeintrthreshold or more free bytes in the fifo. also, an interrupt is generated when serviceintr is cleared to 0 whenever there are writeintrthreshold or more free bytes in the fifo. b. (1) when serviceintr is ?0?, dmaen is 0, direction is ?1? and there are readintrthreshold or more bytes in the fifo. (2) an interrupt is also generated when serviceintr is cleared to ?0? whenever there are readintrthreshold or more bytes in the fifo.
smsc ds ? FDC37N958FR page 122 rev. 09/01/99 3. when nerrintren is 0 and nfault transitions from high to low or when nerrintren is set from ?1? to ?0? and nfault is asserted. 4. when ackinten is ?1? and the nack signal transitions from a low to a high. fifo operation the fifo threshold is set in the chip configuration registers. all data transfers to or from the parallel port can proceed in dma or programmed i/o (non-dma) mode as indicated by the selected mode. the fifo is used by selecting the parallel port fifo mode or ecp parallel port mode. (fifo test mode will be addressed separately.) after a reset, the fifo is disabled. each data byte is transferred by a programmed i/o cycle or pdrq depending on the selection of dma or programmed i/o mode. the following paragraphs detail the operation of the fifo flow control. in these descriptions, ranges from 1 to 16. the parameter fifothr, which the user programs, is one less and ranges from 0 to 15. a low threshold value (i.e. 2) results in longer periods of time between service requests, but requires faster servicing of the request for both read and write cases. the host must be very responsive to the service request. this is the desired case for use with a "fast" system. a high value of threshold (i.e. 12) is used with a "sluggish" system by affording a long latency period after a service request, but results in more frequent service requests. dma transfers dma transfers are always to or from the ecpdfifo, tfifo or cfifo. dma utilizes the standard pc dma services. to use the dma transfers, the host first sets up the direction and state as in the programmed i/o case. then it programs the dma controller in the host with the desired count and memory address. lastly it sets dmaen to ?1? and serviceintr to 0. the ecp requests dma transfers from the host by activating the pdrq pin. the dma will empty or fill the fifo using the appropriate direction and mode. when the terminal count in the dma controller is reached, an interrupt is generated and serviceintr is asserted, disabling dma. in order to prevent possible blocking of refresh requests dreq shall not be asserted for more than 32 dma cycles in a row. the fifo is enabled directly by asserting npdack and addresses need not be valid. pintr is generated when a tc is received. pdrq must not be asserted for more than 32 dma cycles in a row. after the 32nd cycle, pdrq must be kept unasserted until npdack is deasserted for a minimum of 350nsec. (note: the only way to properly terminate dma transfers is with a tc.) dma may be disabled in the middle of a transfer by first disabling the host dma controller. then setting serviceintr to 1, followed by setting dmaen to ?0?, and waiting for the fifo to become empty or full. restarting the dma is accomplished by enabling dma in the host, setting dmaen to ?1?, followed by setting serviceintr to 0. dma mode - transfers from the fifo to the host note: in the reverse mode, the peripheral may not continue to fill the fifo if it runs out of data to transfer, even if the chip continues to request more data from the peripheral. the ecp activates the pdrq pin whenever there is data in the fifo. the dma controller must respond to the request by reading data from the fifo. the ecp will deactivate the pdrq pin when the fifo becomes empty or when the tc becomes true (qualified by npdack), indicating
smsc ds ? FDC37N958FR page 123 rev. 09/01/99 that no more data is required. pdrq goes inactive after npdack goes active for the last byte of a data transfer (or on the active edge of nior, on the last byte, if no edge is present on npdack). if pdrq goes inactive due to the fifo going empty, then pdrq is active again as soon as there is one byte in the fifo. if pdrq goes inactive due to the tc, then pdrq is active again when there is one byte in the fifo, and serviceintr has been re-enabled. (note: a data underrun may occur if pdrq is not removed in time to prevent an unwanted cycle.) programmed i/o mode or non-dma mode the ecp or parallel port fifos may also be operated using interrupt driven programmed i/o. software can determine the writeintrthreshold, readintrthreshold, and fifo depth by accessing the fifo in test mode. programmed i/o transfers are to the ecpdfifo at 400h and ecpafifo at 000h or from the ecpdfifo located at 400h, or to/from the tfifo at 400h. to use the programmed i/o transfers, the host first sets up the direction and state, sets dmaen to 0 and serviceintr to 0. the ecp requests programmed i/o transfers from the host by activating the pintr pin. the programmed i/o will empty or fill the fifo using the appropriate direction and mode. note: a threshold of 16 is equivalent to a threshold of 15. these two cases are treated the same. programmed i/o - transfers from the fifo to the host in the reverse direction an interrupt occurs when serviceintr is 0 and readintrthreshold bytes are available in the fifo. if at this time the fifo is full it can be emptied completely in a single burst, otherwise readintrthreshold bytes may be read from the fifo in a single burst. readintrthreshold = (16-) data bytes in fifo an interrupt is generated when serviceintr is 0 and the number of bytes in the fifo is greater than or equal to (16-). (if the threshold = 12, then the interrupt is set whenever there are 4-16 bytes in the fifo.) the pint pin can be used for interrupt-driven systems. the host must respond to the request by reading data from the fifo. this process is repeated until the last byte is transferred out of the fifo. if at this time the fifo is full, it can be completely emptied in a single burst, otherwise a minimum of (16- ) bytes may be read from the fifo in a single burst. programmed i/o - transfers from the host to the fifo in the forward direction an interrupt occurs when serviceintr is 0 and there are writeintrthreshold or more bytes free in the fifo. at this time if the fifo is empty it can be filled with a single burst before the empty bit needs to be re-read. otherwise it may be filled with writeintrthreshold bytes. writeintrthreshold = (16-) free bytes in fifo an interrupt is generated when serviceintr is 0 and the number of bytes in the fifo is less than or equal to . (if the threshold = 12, then the interrupt is set whenever there are 12 or less bytes of data in the fifo.) the pint pin can be used for interrupt-driven systems. the host must respond to the request by writing data to the fifo. if at this time the fifo is empty, it can be completely filled in a single burst, otherwise a minimum of (16-) bytes may be written to the fifo in a single burst. this process is repeated until the last byte is transferred into the fifo.
smsc ds ? FDC37N958FR page 124 rev. 09/01/99 parallel port interface multiplexor the parallel port physical interface (pppi) may be owned and controlled by any of three sources. the sources are detailed as follows: table 51 - parallel port multiplexing options pppi controlling source device description config register 0x25 bits[4:3] pp_ha 8051 the parallel port physical interface is configured as a spp mode bi-directional parallel port controlled directly by the 8051 through a set of memory mapped external ram registers. [x:x] 0 fdc the parallel port physical interface is configured as a standard floppy disk drive interface. all configuration and control bits pertaining to the fdc logical device apply to the pppi in this mode [1:0] or [0:1] 1 host the parallel port physical interface is configured as the legacy parallel port which supports compatible, spp, epp and ecp modes of operation. all configuration and control bits pertaining to the parallel port logical device apply to the pppi in this mode. [0:0] or [1:1] 1 when the host (parallel port logical device) owns/controls the parallel port interface, its state (i.e., pwrdown) determines the states of the pins. when the fdc (fdc logical device) owns/controls the parallel port interface, its state (i.e., powerdown) determines the state of the pins. when the 8051 controls/owns the parallel port interface, it has direct control of the parallel port physical interface pins. under 8051 control the parallel port output pins are always enabled or driven and only tri-state when vcc2 is removed (powergood=0). if the host does not have control of the parallel port physical interface (pppi), then it is left as a function of the software driver or bios to de- activate the drq and irq of the parallel port logical device by either setting its dma channel select configuration register to 0x04 and its interrupt select configuration regsiter to 0x00 or by clearing the parallel port logical device?s activate bit. also, if the host does not have control of the pppi, then the following parallel port logical device registers are read as follows.
smsc ds ? FDC37N958FR page 125 rev. 09/01/99 data register (read) = last data register (write). control register (read): read as ?cable not connected? [strobe, autofd, and slc = 0 and ninit = 1. status register (read): nbusy, pe, slct = 0, nack, nerr = 1. note: bit d7 of the 8051 memory mapped disable register (parallel port enable bit) has no effect on the parallel port physical interface pins when the port is owned by any source other than the the host (parallel port logical device). host (legacy) parallel port interface (FDC37N958FR standard) in this mode, the parallel port pins are controlled by the host through the parallel port logical device. refer to the configuration section and the parallel port section for information on the configuration and control registers respectively. parallel port fdc interface in this mode, the floppy disk control signals are available on the parallel port pins. when this mode is selected, the parallel port is not available to the host. parallel port fdc pin out the fdc signals are muxed onto the ?parallel port pins as shown in the following table. outputs are od24, open drain which sink 24ma. table 52 - parallel port floppy pin out connector pin # chip pin # parallel port spp mode fdc mode signal name pin direction signal name pin direction 1 -- nstb i/o nds0 (o)* 2 -- pd0 i/o nindex i 3 -- pd1 i/o ntrk0 i 4 -- pd2 i/o nwp i 5 -- pd3 i/o nrdata i 6 -- pd4 i/o ndskchg i 7 -- pd5 i/o mid0 i 8 -- pd6 i/o nmtr0 (o)* 9 -- pd7 i/o mid1 i 10 -- nack i nds1 (o)* 11 -- busy i nmtr1 (o)* 12 -- pe i nwdata o 13 -- slct i nwgate o 14 -- nalf i/o drvden0 o 15 -- nerr i nhdsel o 16 -- ninit i/o ndir o 17 -- nslctin i/o nstep o * these pins are outputs in mode ppfd2; in mode ppfd1 only one pair, depending on drive swap bit, is active and should be connected to the fdd, the inactive pair should not be connected to the fdd.
smsc ds ? FDC37N958FR page 126 rev. 09/01/99 parallel port fdc control there are two modes of operation, ppfd1 and ppfd2. these modes can be selected in global configuration register 0x25 (device mode), bits 3 and 4. ppfd1 mode has only drive 1 on the parallel port pins; ppfd2 mode has drive 0 and 1 on the parallel port pins. note: the drive swap bit, fdd mode configuration register bit-4 (ld0_crf0), can be used to swap the motor and drive select outputs on of the parallel port fdc. ppfd1: drive 0 is on the fdc pins. drive 1 is on the parallel port pins. drive swap bit = 0 drive 1 is on the fdc pins. drive 0 is on the parallel port pins. drive swap bit = 1 ppfd2: drive 0 is on the parallel port pins. drive 1 is on the parallel port pins. the following fdc output pins are open drain 24ma outputs when the parallel port fdc is selected by the drive select register. reminder, it is up to the designer to provide pull-up resistors on these fdc output pins. nwdata, drvden0, nhdselm nwgate, ndir, nstep, nds1, nds0, nmtr0, nmtr1. parallel port - 8051 control (FDC37N958FR standard) in this mode, the parallel port pins are controlled by the 8051 through a set of three on-chip memory mapped registers. the memory mapped registers are the par port status, the par port control, and the par port data registers. in this mode, the parallel port pins are not controlled by the parallel port logical device. refer to the 8051 section of this specification for information on these control registers. table 53 - fdc on parallel port activation control fdc parallel port mode cr25 bits [4:3] fdc active bit l0-cr30-bit0 fdc in power down parallel port active bit parallel port in power down pp_ ha parallel port pins (mode) state 01 or 10 0 x x x 1 (fdc) inactive 01 or 10 1 n x x 1 (fdc) active 01 or 10 1 y x x 1 (fdc) inactive 00 or 11 x x 0 x 1 (parallel port) inactive 00 or 11 x x 1 n 1 (parallel port) active 00 or 11 x x 1 y 1 (parallel port) inactive 00 or 11 x x x x 0 (8051 mode) active inactive = hi-z on pins active = od24/o24 as per selected mode. the fdd pins that are multiplexed onto the parallel port function independently of the state of the parallel port logical device. this affects the pins when cr25 bits [4:3] are 01 or 10. (note: fdc mode bits l0-crf0-b[7:6] have no effect on the parallel port pins).
smsc ds ? FDC37N958FR page 127 rev. 09/01/99 8051 embedded controller features " 32k external rom " 256 byte internal scratch rom " 256 bytes internal ram " 256 bytes of external ram " 256 byte external memory/mapped control register area " 128 byte special function register area " access to 256 byte rtc cmos ram " 8042 style keyboard controller host interface " six interrupt sources " watch dog timer (wdt) 8051 functional overview the 8051 embedded controller is a fully static cmos core compatible with the industry- standard 80c51 microcontroller. this section concentrates on the FDC37N958FR enhancements to the 80c51. for general information about the 80c51, refer to the hardware description of the 8051, 8052, and 80c51 and the 80c51bh-1/80c51bh-2 chmos single-chip 8 bit microcomputer data sheets in the 8 bit embedded controller handbook. a large set of external memory/mapped control registers provide the 80c51 core with the ability to directly control many functional blocks of the FDC37N958FR. functional blocks below are the functional blocks that the 8051 core has control of through its on-chip memory/mapped external registers. ! 8042 sytle keyboard controller interface ! extended interrupts ! power management functions ! direct keyboard scan matrix (up to 128 keys) ! four channel ps/2 interface ! access bus interface ! led controls ! two pulse width modulators ! rtc cmos ram access ! 8051 control of the parallel port interface ! 42 general purpose i/o (gpio) pins
smsc ds ? FDC37N958FR page 128 rev. 09/01/99 powering up or reseting the 8051 default reset conditions the FDC37N958FR has two sources of reset: a vcc1 power on reset (vcc1 por) or a vcc2 por. an FDC37N958FR reset from any of these sources will cause the hardware response shown in table 55, 8051 on-chip external memory mapped registers. note that the values shown are those prior to any resident firmware control. refer to table 55 for the effect of each type of reset on each of the on-chip registers. power-up sequence when the 8051 first powers up by vcc1, the ring oscillator is started, once this has stabilized, the 8051 starts executing from program address 00. once running, the 8051 can access all of the registers that are on vcc1 and if vcc2 is at 5v it can access all of the registers on vcc2. see table 55 for vcc1 powered on-chip registers that are reset upon vcc2 power on reset (vcc2 por). it is important that 8051 firmware not initialize or write to any of these registers until 1ms following vcc2 = 5v and pwrgd = 1. note: in order to guarantee that the external flash device has powered up and is ready to operate before the 8051 attempts to access it, the internal vcc1 por pulse has been extended to 20ms. the internal vcc1 por signal is asserted upon vcc1 reaching a valid level and will remain asserted for a period of 20ms following the assertion of the vcc1_pwrgd pin.
smsc ds ? FDC37N958FR page 129 rev. 09/01/99 figure 4 - system power up sequence no power to system (vcc0, vcc1, vcc2 off) ring oscillator is started once the ring oscillator has stabilized, the 8051 is held in reset for the required number of clock cycles and then released. nea = 0 ? n vcc0, vcc1 on; vcc2 off the 8051 begins executing from program address 00h. y the 8051 begins executing code at address 8000h. vcc1 powered registers are reset to their vcc1 por values. ireset_out bit forced high and latched by the fdc37c957fr hardware
smsc ds ? FDC37N958FR page 130 rev. 09/01/99 system reset sequence figure 5 - typical system reset sequence 
    
     !  " !#
 $%&'$()*+,-. !-#  /0 1 '  #"  233$&45$       # 233$&45$-  6  $%&78 233$&45$/#9 $%&78/
 #! 6  :#" ;   ":#"2<= 
! #   
  " # ' 233$&45$! $ ;2>0 1 ' ' '*;   #?#" 
 ?   
!@!##   
! ##
 '*;233$&45$   $ #   $%&78(+/ 6=3=(a*+/)"   )
"!# 
  
  " ?   ?"   " b  #  c%;b4!!    0  233$&45$ 233$&45$!
smsc ds ? FDC37N958FR page 131 rev. 09/01/99 clock source external clock signal the x1k clock source is from a 14.318mhz ttl compatible clock. in ?sleep? mode, the external clock signal on x1k is not loaded by the chip. internal clock signal the 8051 may program itself to run off of an internal ring oscillator having a frequency range between 4 and 12mhz. this is not a precise clock, but is meant to provide the 8051 with a clock source when vcc2 is shut down in the system. 8051 memory map the 8051 can address 256b of internal scratch rom and 32k of external rom. the nea pin is used to enable access to the 256b of internal scratch rom or external program rom. the FDC37N958FR also contains 256 bytes of internal on-chip ram. when nea=0, all the rom is addressed as the external rom. it can support up to 32k bytes of external code memory addressed as 00h to 7fffh (the addresses from 8000h to ffffh wrap to the same addresses as 00h to 7fffh). this 32k can be mapped to any of the eight 32k memory blocks in the 256k external rom by the kmem register. at initial power-up (vcc1 por) the chip will execute from the block selected by the default value of the kmem register. the 8051 can access upto 32k bytes of external ram addressed from 0-7fffh. refer to table 54 for a list of the implemented on-chip memory mapped registers. external memory addressed from 8000h-ffffh will access the 32k bytes of program memory (8000-ffffh) selected by the kmem register. the 256 bytes of ram from 7e00h-7effh as well as the 256 bytes of scratch ram from 7d00h-7dffh are powered by vcc1. these are general purpose read/write registers available to the 8051. the scratch ram may be converted into scratch rom by setting the memory map control bit. memory map configuration control bit the configuration register 0, an 8051 memory mapped register at address 7ff4h includes a bit called the memory map control bit (mmc). the mmc bit is bit-3 of this register and defaults to zero on vcc1 por. when mmc=0 the 8051 memory map will contain an additonal 256 bytes of external scratch ram in the address range 7d00h through 7dffh. when mmc=1 the scratch ram at 7d00h-7dffh becomes scratch rom at 00h-0ffh. the configuration register 0 register is described in the 8051 control register section.
smsc ds ? FDC37N958FR page 132 rev. 09/01/99 memory map with [nea=0] if nea is held low the 8051 memory map is shown in figure 6 below. program memory data memory external internal sfr (direct only) direct and indirect indirect only 00h 80h 7d00h 7e00h 7f00h 7fffh m/m registers ram scratch ram 8000h ffffh same as 0000h - 7fffh nea = 0 , mmc bit = x external ffh 80h ffh figure 6 - memory map with nea = 0, mmc = x instructions to access memory: mov: internal ram/registers. movc: program rom from 0000h through ffffh movx: external ram from 7d00h through 7fffh -and- external rom from 8000h through ffffh. (allows flashing of rom).
smsc ds ? FDC37N958FR page 133 rev. 09/01/99 memory map with [nea=1] this section describes the 8051 memory map when the nea pin is high. the mmc bit determines the configuration of the 8051?s memory map. when nea=1 an additional 256 of re-writeable rom space can be added to the 8051?s internal rom space to allow patch code upgrades. in order to take advantage of this extra 256 bytes of scratch ram/rom certain design considerations must be met as outlined below. 1. interrupt service routines must be absolutely located or jmp instructions must be located at {0x03, 0x0b, 0x13, 0x1b, 0x23, 0x2b} to {0x8003, 0x800b, 0x8013, 0x801b, 0x8023, 0x802b} respectively. this leaves (256-51) = 205 bytes for patch code. 2. allows interrupt service routines to be patched. 3. requires a boot block flash type part.
smsc ds ? FDC37N958FR page 134 rev. 09/01/99 mmc bit = 0 when the mmc bit is low (vcc1 por default) a hard coded long jump ljmp to 8000h is encoded at addresses 00h through 02h and a 256 byte scratch ram is located at external addresses 7d00-7dff. the encoding for the hard coded long jump is is shown in table 54. table 54 - hard coded ljmp to 8000h 8051 address encoding 00h 02h 80h 02h 00h program memory data memory external internal sfr (direct only) direct and indirect indirect only 00h 80h 7d00h 7e00h 7f00h 7fffh m/m registers ram scratch ram 8000h ffffh nea = 1 , re g mmc bit = 0 hard coded internal 00h 02h 32k external ffh 80h ffh figure 7 - memory map with nea =1, mmc = 0 instructions to access memory: mov: internal ram/registers. movc: program rom from 8000h through ffffh movx: external ram from 7d00h through 7fffh -and- external rom from 8000h through fffh. (allows flashing of rom).
smsc ds ? FDC37N958FR page 135 rev. 09/01/99 mmc bit = 1 when the mmc bit is high the scratch ram at 7d00h-7dffh is disabled and now becomes the executable internal scratch rom at address locations 00h-0ffh. the hard coded ljmp to 8000h is overridden by the scratch rom. program memory data memory external internal sfr (direct only) direct and indirect indirect only 00h 80h 7d00h 7e00h 7f00h 7fffh m/m registers ram scratch rom internal 8000h ffffh nea = 1, mmc bit = 1 00h ffh 32k external ffh 80h ffh figure 8 - memory map with nea =1, mmc =1 instructions to access memory: mov: internal ram/registers. movc: program rom from 8000h through ffffh called from 00h-0ffh or from 8000h-0ffffh. program rom from 00h through 0ffh called from 00h-0ffh only. movx: external ram from 7e00h through 7fffh -and- external rom from 8000h through ffffh. (allows flashing of rom).
smsc ds ? FDC37N958FR page 136 rev. 09/01/99 8051 control registers internal special function registers (sfrs) table 55 is a map of the on-chip special function register (sfr) space. the FDC37N958FR provides all standard 80c51 sfrs (see the hardware description of the 8051 and 8052 and 80c51 in the 8 bit embedded controller handbook). table 55 - sfr memory map starting address ending address f8h msiz ffh f0h b* f7h e8h efh e0h acc* e7h d8h dfh d0h psw* d7h c8h cfh c0h c7h b8h ip* bfh b0h p3* b7h a8h ie* afh a0h p2* a7h 98h scon* sbuf 9fh 90h p1* 97h 88h tcon* tmod tl0 tl1 th0 th1 8fh 80h p0* sp dpl dph res res res pcon 87h first column = starting address last column = ending address res = reserved for test *=bit-addressable register port 0: full sfr, can be used for external memory access (but this corrupts the values in the sfr). can not sample any pins when reading the sfr. port 1: does not exist. port 2: full sfr, can be used to supply the high address byte for internal, external (movx) access to the memory mapped registers or the flash registers. port 3: does not exist.
smsc ds ? FDC37N958FR page 137 rev. 09/01/99 external memory mapped control registers (mmcrs) table 56 describes the complete set of on-chip memory-mapped registers accessed by the 8051. the internal memory mapped registers can be accessed by the following types of instructions. 1. movx a,@dptr 2. movx @dptr,a 3. mov p2,#7fh movx a,@rx (r0 or r1 only) 4. mov p2,#7fh movx @rx,a (r0 or r1 only) isaxxh = system isa i/o address idxxxh = open mode index addressable registers, see configuration section. 8051 addresses = on-chip external memory mapped register locations table 56 - 8051 on-chip external memory mapped registers sys. index sys. r/w 8051 address (7f00+) 8051 r/w power source vcc1 por vcc2 por zero wait state (8) notes see page # host i/f data reg [kbd data/ command write reg.] isa 60h isa 64h w f1h r vcc1 n/a y (1,7) 170 host i/f data reg [kbd data read reg.] isa 60h r f1h w vcc1 n/a y 170 host i/f status reg [kbd status reg.] isa 64h r f2h r/w vcc1 00h y (2,7) 171 rtc address 1 isa 70h r/w ------ n/a vcc1 00h 211 rtc data 1 isa 71h r/w ------ n/a vcc1 n/a 211 rtc address 2 isa 74h r/w ------ n/a vcc1 00h 211 rtc data 2 isa 76h r/w ------ n/a vcc1 n/a 211 htimer ------ n/a f3h r/w vcc1 00h 166 config reg 0 ------ n/a f4h r/w vcc1 00h 144 rtccntrl ------ n/a f5h r/w vcc1 80h 6 191 rtcaddrl ------ n/a f6h r/w vcc1 00h 193 rtcdatal ------ n/a f7h r/w vcc1 00 193 rtcaddrh ------ n/a f8h r/w vcc1 00h 193 rtcdatah ------ n/a f9h r/w vcc1 00h 193 aux host data reg [kbd data read reg] isa 60h r fah r/w vcc1 n/a y 3 173 gatea20 ------ n/a fbh r/w vcc1 01h 176 pcobf ------ n/a fdh r/w vcc1 00h 172 setga20l ------ n/a feh w vcc1 n/a 176 rstga20l ------ n/a ffh w vcc1 n/a 176
smsc ds ? FDC37N958FR page 138 rev. 09/01/99 sys. index sys. r/w 8051 address (7f00+) 8051 r/w power source vcc1 por vcc2 por zero wait state (8) notes see page # interrupt 0 source register ------ n/a 00h r vcc1 00h 150 interrupt 0 mask register ------ n/a 01h r/w vcc1 00h 150 interrupt 1 source register ------ n/a 02h r vcc1 00h 151 interrupt 1 mask register ------ n/a 03h r/w vcc1 00h 151 keyboard scan out ------ n/a 04h w vcc1 20h 180 keyboard scan in ------ n/a 04h r vcc1 n/a 180 device rev register ------ n/a 06h r vcc1 see note 13 143 device id register ------ n/a 07h r vcc1 07h 143 system-to- 8051 mailbox register 0 idx 82h r/w 08h rc vcc1 00 y 4 183 8051-to- system mailbox register 1 idx 83h rc 09h r/w vcc1 00 y 5 183 mailbox register [2-f] idx 84h-91h r/w 0a-17h r/w vcc1 00h y 184 gpio direction register a ------ n/a 18h r/w vcc1 00h 199 gpio ouput register a ------ n/a 19h r/w vcc1 00h 200 gpio input register a ------ n/a 1ah r vcc1 n/a 200 gpio direction register b ------ n/a 1bh r/w vcc1 00h 200 gpio ouput register b ------ n/a 1ch r/w vcc1 00h 201 gpio input register b ------ n/a 1dh r vcc1 n/a 201 gpio direction register c ------ n/a 1eh r/w vcc1 00h 12 201 gpio ouput register c ------ n/a 1fh r/w vcc1 00h 12 202 gpio input register c ------ n/a 20h r vcc1 n/a 202
smsc ds ? FDC37N958FR page 139 rev. 09/01/99 sys. index sys. r/w 8051 address (7f00+) 8051 r/w power source vcc1 por vcc2 por zero wait state (8) notes see page # led register ------ n/a 21h r/w vcc1 see note see note 13 190 out register d ------ n/a 22h r/w vcc1 ffh 12 202 out register e ------ n/a 23h r/w vcc1 0fh 12 203 in register f ------ n/a 24h r vcc1 n/a 203 pwm0 register idx 92h r/w 25h r/w vcc1 00h y 191 pwm1 register idx 93h r/w 26h r/w vcc1 00h y 191 kstp_clk ------ n/a 27h r/w vcc1 10h 145 kmem ------ n/a 29h r/w vcc1 00h 156 wakeup source 1 ------ n/a 2ah r vcc1 00h 166 wakeup source 2 ------ n/a 2bh r vcc1 00h 166 wakeup mask 1 ------ n/a 2ch r/w vcc1 00h 167 wakeup mask 2 ------ n/a 2dh r/w vcc1 00h 168 multiplexing 3 register ------ n/a 30h r/w vcc1 00h 209 access.bu s control reg ------ n/a 31h w vcc1 00h 187/ 225 access.bu s status reg ------ n/a 31h r vcc1 81h 187/ 225 access.bu s own address reg ------ n/a 32h r/w vcc1 00h 187/ 229 access.bu s data reg ------ n/a 33h r/w vcc1 00h 188/ 229 access.bu s clock ------ n/a 34h r/w vcc1 00h 188/ 230 wakeup source 3 ------ n/a 35h r vcc1 00h 167 wakeup mask 3 ------ n/a 36h r/w vcc1 ffh 168 wdt control/statu s ------ n/a 37h r/w vcc1 00h 153 wdt timer ------ n/a 38h r/w vcc1 ffh 153 pp status reg n/a 3ah r/w vcc2 00h 9 195 pp control reg ------ n/a 3bh r/w vcc2 00h 196 pp data reg ------ n/a 3ch r/w vcc2 00h 196 multiplexing 1 register ------ n/a 3dh r/w vcc1 00h 204
smsc ds ? FDC37N958FR page 140 rev. 09/01/99 sys. index sys. r/w 8051 address (7f00+) 8051 r/w power source vcc1 por vcc2 por zero wait state (8) notes see page # output enable register 3eh r/w vcc1 see note see note 11 147 disable register ------ n/a 3fh r/w vcc1 00h 146 multiplexing 2 register ------ n/a 40h r/w vcc1 00h 207 ps/2 port1 control register n/a 41h r/w vcc2 00h 185/ 233 ps/2 port1 status register n/a 42h r vcc2 00h 185/ 234 ps/2 port1 error status register n/a 43h r vcc2 00h 186/ 234 ps/2 port1 transmit reg n/a 44h w vcc2 00h 186/ 234 ps/2 port1 receive reg n/a 45h r vcc2 00h 186/ 234 reserved - smsc ------ n/a 46h-48h -- ------- ---- ---- _ _ _ ps/2 port2 control register ------ n/a 49h r/w vcc2 00h 185/ 234 ps/2 port2 status register ------ n/a 4ah r vcc2 00h 185/ 234 ps/2 port2error status register ------ n/a 4bh r vcc2 00h 186/ 234 ps/2 port2 transmit reg ------ n/a 4ch w vcc2 00h 186/ 234 ps/2 port2 receive reg ------ n/a 4dh r vcc2 00h 186/ 234 reserved - smsc ------ n/a 4eh-4fh -- ------- ---- ---- _ _ _ 256 bytes of ram ------ n/a 7e00- 7effh r/w vcc1 _ _ _ notes 1. although the input and output data registers are physically separate, they share address 7ff1h. 2. the FDC37N958FR cpu cannot write to some bits of the status register. 3. writing to the auxiliary output data register loads the output data register and can set the auxobf1 output if enabled. this does not set the pcobf output.
smsc ds ? FDC37N958FR page 141 rev. 09/01/99 4. interrupt is cleared when read by the 8051 5. interrupt is cleared when read by the host 6. see rtc control register definition 7. when accessed for a read or write by the system the registers marked with a ?y? will drive the zero wait state pin active. 8. bit 0 is the only writable or resetable bit in this register. 9. when ireset_out is cleared (written from ?1? to?0?) 8051stp_clk bit d0 as well as hmem bits d1 and d0 are all set to ?1?. 10. vcc1 por = 00000x10b, vcc2 por = 00000x1xb where x is not affected by vcc2 por, but is left at the current value. 11. these registers are reset 500us to 1ms following the condition that both vcc2 is valid and pwrgd is asserted given that the rtc is in normal mode and the vrt bit is set (refer to the rtc section). if the rtc is not in normal mode and/or the vrt bit is not set then these registers are reset within 10 " s following the condition that both vcc2 is valid and pwrgd is asserted. 12. this register is powered by vcc1. the data contents remains undefined until vcc2 por. 13. this register is impacted by a device functional revision. see functional revision addendum on page 308 for vcc1 and vcc2 por impact and default values.
smsc ds ? FDC37N958FR page 142 rev. 09/01/99 8051 configuration/control memory mapped registers device rev register by reading this register, 8051 firmware can confirm the device revision that it is running on. host n/a 8051 0x7f06 (r) power vcc1 default see note d7 d6 d5 d4 d3 d2 d1 d0 8051 r rrrrrrrr bit description00000001 note: this register is hardwired. this register is impacted by device functional revision. see functional revision addendum on page 308 for devault values. device id register by reading this register, 8051 firmware can determine which device it is running on. host n/a 8051 0x7f07 (r) power vcc1 default 0x07 d7 d6 d5 d4 d3 d2 d1 d0 8051 r rrrrrrrr bit description00000111
smsc ds ? FDC37N958FR page 143 rev. 09/01/99 configuration register 0 host n/a 8051 0x7ff4 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 auxh 0 obfen 0 mmc pcobfen saen sleepflag auxh aux in hardware; when high, auxobf of the status register is set in hardware by a write to 7ffah. when low, auxobf of the status register is a user defined bit (ud) and r/w. obfen when set pcobf is gated onto kirq and auxobf1 is gated onto mirq. when low, kirq and mirq are driven low. software should not change this bit when obf of the status register is equal to 1. mmc memory map control bit : when mmc=0, a 256 byte scratch ram area at 7d00h is available to the 8051. when mmc=1 the scratch ram at 7d00h-7dffh becomes scratch rom at 00h-- ffh. pcobfen when high, pcobf reflects whatever value was written to the pcobf firmware latch assigned to 7ffdh. when low, pcobf reflects the status of writes to 7ff1h (the output data register). saen software-assist enable. when set to ?1? saen allow control of the gatea20 signal via firmware. if saen is reset to ?0?, gatea20 corresponds to either the last host-initiated control of gatea20 or the firmware write to 7ffeh or 7fffh. sleepflag if sleepflag=?0? when pcon bit-0 is set, the 8051 enters ?idle? mode, whereas if sleepflag=?1? when pcon bit 0 is set the 8051enters ?sleep? mode. this bit is cleared by the occurrence of any wake-up events and on vcc1 por.
smsc ds ? FDC37N958FR page 144 rev. 09/01/99 kstp_clk register host n/a 8051 0x7f27 power vcc1 default 0x10 d7 d6 d5 d4 d3 d2 d1 d0 kbclk1 kbclk0 kbclk/rosc roscen stp_cnt[3:0] note: rosc refers to the ring oscillator. stp_cnt[x] this defines the number of machine cycles from when the internal ireset_out bit is cleared until the external reset_out pin goes inactive low (deasserts) . roscen this bit reflects the state of the ring oscillator clock at all times. the 8051 can write this bit to start or stop the ring oscillator. other hardware events can also start or stop this clock. = 1 turn on ring oscillator = 0 turn off ring oscillator this bit is reset when the 8051 goes into ?sleep? mode and is set when the 8051 first wakes up from ?sleep? mode. kbclk/rosc this bit is used to control the clock source for the 8051. 1 = 8051 clock source is kbclk 0 = 8051 clock source is ring oscillator. this bit is reset when the 8051 just wakes up from the ?sleep? mode kbclk1 kbclk0 0 0 stop kbclk (default) 0 1 kbclk = 12 mhz 1 0 kbclk = 14. 318 mhz 1 1 kbclk = 16 mhz
smsc ds ? FDC37N958FR page 145 rev. 09/01/99 disable register host n/a 8051 0x7f3f power vcc1 default 0x00 if ?0?, these bits override the enable bits in the configuration registers. d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w system r/w n/a n/a n/a n/a n/a n/a n/a n/a parallel port 1 = enable 0 = disable serial port 1 = enable 0 = disable ir port 1 = enable 0 = disable floppy port 1 = enable 0 = disable user defined system flash interface 1 = enable 0 = disable note 1 re- served re- served note 1: if d2=0, then the flash is write protected from the system. the system can still read the flash.
smsc ds ? FDC37N958FR page 146 rev. 09/01/99 output enable register host n/a 8051 0x7f3e power vcc1 default 00000x10b on vcc1 por 00000x1xb on vcc2 por output enable register vcc1 por = 0x00000x10, vcc2 por = 00000x1 x b where x means the bit holds its setting preceding vcc2 por. d7-d4 d3 d2 d1 d0 8051 ar r/w r/w r r/w r/w reserved 0 ireset_ ovrd power_good ireset_out 32khz output ar= access rights ireset_out when powergood=1, ireset_out is controlled by the 8051. when powergood=0, ireset_out is forced high (within 100nsec) and latched. the reset_out pin is not driven until vcc2 is applied. ireset_out cannot be cleared by the 8051 until powergood=1. ireset_ovrd ireset override - when cleared the ireset_out bit functions as described above. when set, ireset_out is given direct control over the internal reset and perhaps the reset_out and nreset_out pins without requiring the stop_clk counter or affecting the 8051stp_clk bit or the hmem register. in the override mode, setting ireset_out may or may not drive reset_out high and clearing ireset_out may or may not drive reset_out low. the reset_out override function allows the 8051 to take the rest of the FDC37N958FR chip (sio) out of reset without giving up control (i.e., without stopping its clock and giving the flash interface to the host). on the current FDC37N958FR, reset_out is driven low by this sequence of events. 1) sets stp_cnt to a non-zero value 2) clears ireset_out bit, causing. a) 8051stp_clk bit 0 to get set. b) hmem[7:0] to get set to 0x03 c) and stop counter to start decrementing 3) when stp_cnt reaches 0 the reset_out pin deasserts (goes low) at which point the 8051?s clock stops and the host owns the flash interface. in addition to the above sequence, the FDC37N958FR provides a means for the 8051 to directly control the state of the super i/o block?s internal reset. the FDC37N958FR provides a means for the 8051 to drive low or toggle the chip?s internal reset without stopping the 8051 clock or giving the flash interface to the host.
smsc ds ? FDC37N958FR page 147 rev. 09/01/99 8051 interrupts the FDC37N958FR provides the five standard 8051 interrupts (group 0) plus an additional t5int interrupt which is located at the vector address for timer 2 which is standard on the 8051 standard micro-controller. table 57 describes the interrupts. the group 0 interrupts use the standard 8051 interrupt enable and priority structures. each interrupt is individually enabled or disabled by setting or clearing a bit in the interrupt enable (ie) register (sfr location a8h). each interrupt is programmed to one of two priority levels by setting or clearing a bit in the interrupt priority (ip) register (sfr location b8h). see the "hardware description of the 8051, 8052, and 80c51" in the 8 bit embedded controller handbook for more details. group 0 interrupts (which have modified sources from the standard 80c51 interrupts) are configurable as either level-or-edge sensitive. consult the 8 bit embedded controller handbook for a full description. table 57 - interrupt sources interrupt description vector address polling order active group 0 int0 interrupt int0 03h 0 (ie0) l/e t0int timer 0 interrupt 0bh 1 (ie1) int1 interrupt int1 13h 2 (ie2) l/e t1int timer 1 interrupt 1bh 3 (ie3) serial port serial port interrupt 23h 4 (ie4) e t5int t5 interrupt (1) 2bh 5 (ie5) note: l = level-sensitive, e = edge-sensitive note 1: the t5 interrupt, if enabled, is generated as a result of the occurrence of any un-masked wake-up event.
smsc ds ? FDC37N958FR page 148 rev. 09/01/99 interrupt enable register (ie) this register is based on the standard 8051 ie register. it has been modified to add a definition for bit d5. d7 d6 d5 d4 d3 d2 d1 d0 default00000000 bit def ea reserved t5int interrupt enable bit ri+ti 8051 serial port interrupt enable bit tf1 timer 1 interrupt enable bit int1 external interrupt 1 enable bit tf0 timer 0 interrupt enable bit int0 external interrupt 0 enable bit interrupt priority register (ip) this register is based on the standard 8051 ip register. it has been modified to add a definition for bit d5. d7-d5d5d4d3d2d1d0 default 0 0 0 0 0 0 0 bit def reserved t5int interrupt priority bit 8051 serial port interrupt priority bit timer 1 interrupt priority bit external interrupt 1 priority bit timer 0 interrupt priority bit external interrupt 0 priority bit interrupt polling sequence when two or more interrupts with the same priority level become active during the same machine cycle, the chip's internal polling sequence determines the service order. if all six interrupts are set to the same priority level, and all interrupts become active during the same machine cycle, the 8051 services the interrupts in the order shown in table 57. additional interrupt sources inside the FDC37N958FR, interrupt events from various sources are able to generate either an int0 or int1 8051 interrupt. the 8051 firmware masks these interrupt sources by writing ?1s? into the 8051 int0 or int1 mask registers and enables these interrupts by writing ?0s? into these mask registers. the 8051 can determine the source of the int0 or int1 interrupt by reading the 8051 int0 or int1 source register.
smsc ds ? FDC37N958FR page 149 rev. 09/01/99 8051 int0 source register host n/a 8051 0x7f00 (r) power vcc1 default 0x00 d7-d4d3d2d1d0 8051 r/w r r r r r bit description reserved 1=msb receive data changed 1= wk_ee4 transition (both edges) 1 = wk_ee2 transition (both edges) 1 = wk_ee3 transition (both edges) note: this register is cleared on a read. 8051 int0 mask register host n/a 8051 0x7f01 power vcc1 default 0x00 d7-d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w bit def reserved 1=mask msb 1 = mask wk_ee4 (edge) 1 = mask wk_ee2 transition interrupt 1 = mask wk_ee3 transition interrupt when enabled, int0 is generated on either positive or negative-going edge of wk_ee4 [erdy].
smsc ds ? FDC37N958FR page 150 rev. 09/01/99 8051 int1 source register host n/a 8051 0x7f02 (r) power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w rr r rrrrr bit des. 1= ibf note 1 1 = keyboard scan-in line. note 2 1= ps/2 port2 flag (l to h) 1= ps/2 port1 flag (l to h) 1= trigger (both edges) note 3 1=acc- ess.bus note 4 1= system writes to mailbox register 0 note 5 1= a wake- up event is active bits d0, d2-d6 are cleared by a read. to re-enable these irq?s you must reset the interrupting condition (i.e., all active interrupts must be serviced after reading this register). note 1: the ibf interrupt bit is set when the host writes to the kbd data/command write register and cleared when the 8051 reads the data from that register. note 2: bit d6 is latched on a high to low transition. of any of the keyboard scan lines. note 3: when enabled, int1 is generated on either positive or negative-going edge of trigger. note 4: an access.bus irq is active. note 5: this bit is set when the system writes to mailbox register 0. this bit is cleared by a read of the mailbox 0 register 8051 int1 mask register host n/a 8051 0x7f03 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit def 1= mask ibf 1 = mask the keyboard matrix scan flag 1 = mask ps/2 port2 flag 1 = mask ps/2 port1 flag 1 = mask trigger 1= mask access bus 1 = mask system-to- 8051 mailbox register interrupt 1 = mask wake- up events
smsc ds ? FDC37N958FR page 151 rev. 09/01/99 watch dog timer wdt operation when enabled, the watch dog timer (wdt) circuit will generate a system reset if the user program fails to reload the watchdog timer (wdt) within a specified length of time known as the ?watchdog interval?. the wdt consists of an 8-bit timer (wdt) with a 9-bit prescaler. the prescaler is fed with 32 khz which always runs, even if the 8051 is in sleep state. the 8 bit wdt timer is decremented every (1/32khz) *512 seconds or 16.0 ms. thus, the watchdog interval is programmable between 16ms and 4.08 seconds on 16ms intervals. wdt action if the 8 bit timer (wdt) underflows, a vcc1 por is generated 8051 in idle mode - wdt will be active if enabled. when the wdt timer underflows in idle mode, the 8051 will be reset. it is up to the firmware engineer to design code that uses a timer to generate an interrupt that will exit idle mode and re-initialize the wdt timer and then put the 8051 back into idle mode. 8051 in sleep mode - if enabled, the wdt is active since it is running off of the 32 khz clock. therefore, if the wdt is enabled the 8051 should never remain in the sleep state for more than 4 seconds. wdt activation upon vcc1 por the watch dog timer powers up inactive. the watch dog timer is activated when the wdt enable bit (wdt control bit d1) is set by 8051 firmware. the wdt may be disabled under software control through a specific sequence. software can clear the sdt enable bit by : 1) setting the wle-wdt load enable bit in the wdt control/status register 2) writing 00h to the wdt timer register (this causes the wdt enable and the wle_wdt load enable bits to each reset to 0). once the wdt has been activated, this sequence must be executed in order to disable watchdog operation via software control. note: since a vcc1 por will reset the wdt enable bit, the wdt must be re-enabled after each occurrence. wdt reset mechanism the watchdog timer (wdt) must be reloaded within periods that are shorter than the programmed watchdog interval; otherwise the wdt will underflow and a vcc1 por will be generated. it is the responsibility of the user program to continually execute sections of code which reload the 8 bit timer (wdt). the wdt is reloaded in two stages in order to prevent erroneous software from reloading the watchdog. first wdt control bit d0 (wle- wdt load enable) must be set. then the wdt may be loaded. when the wdt is loaded wle is automatically reset. wdt can not be loaded when wle is reset. since the wdt timer is a down counter , a reload value of 01h results in the minimum wdt interval (16ms) and a reload value of 0ffh results in the maximum wdt interval (4.08 seconds). loading 00h into the wdt disables the wdt and clears the wdt enable bit. note, the 9 bit prescaler is initialized whenever the wdt timer is loaded.
smsc ds ? FDC37N958FR page 152 rev. 09/01/99 wdt memory mapped registers wdt: put at location 7f38 (default = 0xff, on vcc1 por). d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w system r/w n/a bit def wdt timer wdt control/status: put at location 7f37. (default = 0x00, on vcc1 por). d7-d2 d1 d0 8051 r/w r r/w r/w system r/w n/a n/a n/a bit def reserved wdt enable wle-wdt load enable wle watchdog load enable bit must be set to enable writing to the wdt timer register. this bit is automatically reset when the 8051 writes to the wdt register. if this bit is reset, writes to the wdt register are ignored. wdt enable the wdt enable bit must be set by 8051 firmware to enable or start the watch dog timer. a vcc1 por or the above described software sequence will reset this bit.
smsc ds ? FDC37N958FR page 153 rev. 09/01/99 shared flash interface a 256kb flash device (i.e., 28f020) is recommended to store the program code for the 8051 (keyboard bios+) and the system bios. the flash memory can be accessed from the system in blocks of 64kb or from the 8051 in blocks of 32kb. the procedure to access the flash memory is described in the host flash access section. flash interface diagram access to the flash memory is multiplexed inside of the FDC37N958FR. the host cpu only has access to the flash when nreset_out is not asserted and the 8051 stp_clk bit-0 is set. please refer to the timing section for details on this interface. 256k x 8 flash latch ad[7:0] r o m c s i s a b u s addr[17:8] nkbrd nkbwr ale host cpu nce fdc37c957fr n figure 9 - flash interface diagram
smsc ds ? FDC37N958FR page 154 rev. 09/01/99 system flash access map 64k 8051 rom 256k flash rom 0 64k host interface 64k 8051 external ram 0 8000 ffff 8000 ffff 8x 32k blocks 0 ffff internal registers same as 0-7fff figure 10 - 8051 mode 2
smsc ds ? FDC37N958FR page 155 rev. 09/01/99 keyboard bios (kmem) kmem register host n/a 8051 0x7f29 power vcc1 default 0x00 d7-d3 d2d1d0 8051 r/w r/w r/w r/w r/w system r/w n/a n/a n/a n/a bit def 00 on read a[17] a[16] a[15] the 8051 uses this register to access the flash rom in a 32k window. the 8051 is only barred from accessing the flash when 8051stp_clk bit d0 =1 and reset_out=low or deasserted. kmem 17 16 15 flash memory range 0 0 0 000- 7fff 0 0 1 8000- ffff 0 1 0 10000-17fff 0 1 1 18000-1ffff 1 0 0 20000-27fff 1 0 1 28000-2ffff 1 1 0 30000-37fff 1 1 1 38000-3ffff
smsc ds ? FDC37N958FR page 156 rev. 09/01/99 system bios (hmem) hmem register host idx 0x95 8051 n/a power vcc1 default vcc1 por = 0x03 vcc2 por = 0x03 d7-d2 d1 d0 8051 r/w r r r system r/w r/w r/w r/w bit def 0 a[17] a[16] the system uses this register to select a 64k window for access from the 256k flash rom. the host may access the flash when reset_out pin is de-asserted and 8051stp_clk bit d0 = 1. host flash access the FDC37N958FR has a special shared flash rom interface. the 8051 can be stopped to allow the host cpu to access the flash rom after a special handshake sequence is followed. host initiated flash access to access the flash memory, the 8051 must first be placed into idle mode, and then the 8051 clock must be stopped. host flash reads and writes occur when the nromcs pin is asserted along with nmemrd or nmemwr. the register bit ?8051_stpclk? needs to be set by the host to make the 8051 clock stop. the 8051 clock is only stopped when 8051stp_clk=1 and when reset_out pin = low. address bits a[15:0] are supplied by sa[15:0], address bits a[17:16] are supplied by configuration register hmem. for flash access, these address lines and bits are qualified (selected) by 8051stp_clk=1, and the reset_out pin = low (reset_out is driven by the 8051). the 8051 stp_clk is set to ?1? and hmem is set to 03h (effectively resulting in a[17:16] initializing as "11") whenever the 8051 clears the ireset_out bit from ?1? to ?0?. this allows the system to execute from the upper 64k of the flash memory at boot time. to access the other portions of the flash memory, the system software must first change the values of hmem[1:0] register to control address lines a[17:16]. the access to the flash memory uses nfwr for a write and nfrd for a read.
smsc ds ? FDC37N958FR page 157 rev. 09/01/99 the host, wishing to access flash memory, issues a user- defined command to put the 8051into idle mode. system fully powered up and running. reset_out=low, 8051stp_clk=0. 8051 owns flash interface, running keyboard code. 8051goes into idle mode when done using flash, the host resets 8051stp_clk bit 8051 timer irq ? y n the host sets 8051stp_clk = 1 combined with reset_out = low; this causes 8051 clock to stop. host now owns flash interface. 8051 wakes up from idle mode and starts executing from where it left off. (note) note: in order to leave idle mode the 8051 must receive an interrupt; typically a software timer interupt will be used. figure 11 - dynamic sharing of flash interface between host and 8051
smsc ds ? FDC37N958FR page 158 rev. 09/01/99 8051 stp_clk register host idx 0x94 8051 n/a power vcc1 default 0x00 d7 d6 d5-d1 d0 idle host_ flash reserved, set to ?0? 0=8051 clock can run 1=8051 clock stop note: when bit d0=1 the 8051?s clock is not stopped unless the reset_out pin is also de- asserted at which point the host has access to the flash memory. note: only bit d0 is r/w, bits[7:1] are read only. idle : 0 = 8051 not in idle mode 1= 8051 in idle mode host_flash: 0 = host does not have access to flash, in use by 8051 1 = host has access to flash 8051 system power management the 80c51 core provides support for two further power-saving modes, available when inactive: idel mode, typically entered between keystrokes; and sleep mode, entered upon command from the host. the 8051 is wakeable from sleep mode through a set of external and internal events called wake-up events. the events are listed in table 58 - system wake-up events. when exiting the sleep mode, the 8051 will continue executing code from where it left off when put into sleep with no changes to the sfr and pins. the FDC37N958FR is fully static and will pickup from where it left off in the event of a wake-up event. idle mode entering idle mode: idle mode is initiated by an instruction that sets the pcon.0 bit (sfr address 87h) in the keyboard. in idle mode, the internal clock signal to the keyboard cpu is gated off, but not to the interrupt timer and serial port functions. the cpu status is preserved in its entirety: the stack pointer, program counter, program status word, accumulator, and all other registers maintain their data. the port pins hold the logical levels they had when idle mode was activated.
smsc ds ? FDC37N958FR page 159 rev. 09/01/99 system fully powered up and running. reset_out=low, 8051stp_clk=0. 8051 owns flash interface, running keyboard code. 8051 now in idle mode, 8051 clock running. the host either issues a user- defined command to put the 8051into idle mode, or the 8051 code determines that the 8051 should enter idle mode. sleepflag = 0 pcon.0 = 1 figure 12 - entering idle mode
smsc ds ? FDC37N958FR page 160 rev. 09/01/99 unmasked 8051 irq ? n 8051 returns to executing from where it left off prior to entering idle mode. (note) 8051 in idle mode, 8051 clock running. note: in order to leave idle mode the 8051 must receive an interrupt, typically a software timer interrupt will be used. y 8051 leaves idle mode, executes irq service routine code and executes an iret when done. figure 13 - exiting idle mode due to irq exiting idle mode there are two ways to terminate idle mode. first, activation of any enabled interrupt will cause the pcon.0 bit to be cleared by hardware. the interrupt will be serviced and, following the reti, the cpu will resume operation by executing the instruction following the one that put the cpu into idle mode. the second way to terminate the idle mode is with a vcc1 por. note that a vcc1 por will clear the registers. the cpu will not resume program execution from where it left off.
smsc ds ? FDC37N958FR page 161 rev. 09/01/99 sleep mode sleep mode sequence to enter sleep mode, the 8051: 1. turns on the ring oscillator (kstp_clk[4] = 1) 2. switches the clock source (kstp_clk[5] = 0) 3. turns off the clock chip (or the whole system power, vcc2) 4. masks all interrupts except for t5int 5. sets sleepflag = 1 6. sets pcon.0 = 1 7. the ring oscillator will be automatically turned off 8. the 8051 goes into sleep mode. sleep mode is initiated by a user defined command of event to the 8051. when the cpu enters sleep mode, all internal clocks, including the core clocks, are turned off. if an external crystal is used, the internal oscillator is turned off. ram contents are preserved. design note in this mode, the fdc, uart1, uart2 and parallel port are powered off if vcc2 is removed, but the rtc and 8051 are in powerdown (sleep) mode; the chip must consume less than 20 " a, and all wake-up pins must still be active. exiting sleep mode when the 8051 is in sleep mode, all of the clocks are stopped and the 8051 is waiting for an unmasked wake-up event. when the wake- up event occurs, the ring oscillator is started, once this has stabilized, the 8051 starts executing from where it stopped in the sleep mode sequence. once running, the 8051 can access all of the registers that are on vcc1 and if vcc2 is at 5v it can access all of the registers on vcc2. the 8051 running from the ring oscillator clock source can turn on the clock chip, switch its clock source to 16 mhz and then turn off the ring oscillator clock source.
smsc ds ? FDC37N958FR page 162 rev. 09/01/99 system fully powered up and running. reset_out= low, 8051stp_clk= 0. 8051 owns flash interface, running keyboard code. 8051 now in sleep mode, 8051 clock stopped. the host either issues a user- defined command to put the 8051into sleep mode, or the 8051 code determines that the 8051 should enter sleep mode. sleepflag = 1 pcon.0 = 1 8051 switches its clock source to the ring oscillator. 8051 masks all interrupts except for t5int. ring oscillator first gated off from 8051, then turned off. the 8051 may/may not turn off vcc2 to rest of system. figure 14 - entering sleep mode
smsc ds ? FDC37N958FR page 163 rev. 09/01/99 8051 in sleep mode. rtc, 8051 and other vcc1 driven pins are active unmasked wake-up event ? n y t5int generated. turn on ring oscillator. sleepflag = 0. once stabilized, the ring oscillator is gated through to the 8051. the 8051 is now running in idle mode and responds immediately to t5int. 8051 returns to executing from where it left off prior to entering sleep mode. 8051 leaves idle mode, executes t5int service routine (disables t5int) and executes an iret when done. wake up events rtc alarm, power button, ring indicator, etc. figure 15 - exiting sleep mode
smsc ds ? FDC37N958FR page 164 rev. 09/01/99 wake-up events table 58 - system wake-up events pin wake-up events level/edge sensitive internal or external description nri1, nri2 nri1, nri2 edge, high-to-low external uart ring indicator ngpwkup ngpwkup edge, high-to-low external general purpose wakeup source wk_hl1 wk_hl1 edge, high-to-low external wk_hl2 wk_hl2 edge, high-to-low external ab_dat access.bus data going active leading edge, high-to-low internal access.bus interrupt wk_hl3 wk_hl3 edge, high-to-low external wk_hl4 wk_hl4 edge, high-to-low external wk_hl5 wk_hl5 edge, high-to-low external wk_ee1 wk_ee1 either edge external n/a rtc_alrm (1) leading edge, low-to-high internal rtc alarm n/a htimer leading edge, low-to-high internal hibernation timer wk_ee2 wk_ee2 either edge external wk_ee3 wk_ee3 either edge external wk_hl6 wk_hl6 edge, high-to-low external wk_ee4 wk_ee4 either edge external n/a (function of ksi[7:0] pins) wk_anykey edge, high-to-low internal any keyboard key pressed gpio8/com- rx wk_hl7 [ir_wakeup] edge, high-to-low external ir energy detected on the gpio/com-rx receive pin. irrx wk_hl8 [ir_wakeup] edge, high-to-low external ir energy detected on the rrrx receive pin.
smsc ds ? FDC37N958FR page 165 rev. 09/01/99 wakeup source register 1 host n/a 8051 0x7f2a (r) power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w rrr r r r r r def 1 = wk_hl5 1 = wk_hl2 occurs 1 = wk_hl1 occurs 1 = ab_dat access. bus interrupt occurs (note 3) 1 = wk_hl3 occurs 1 = wk_hl4 occurs 1 = wk_ee1 changed (note 1) 1 = rtc_al rm occurs (note 2) note : all the bits in this register are cleared on a read of this register. note 1: input is going from low to high or from high to low (read the gpio register to find out the value of pin) note 2: the rtc_alrm wake-up is an internally-generated low-to-high edge, produced when the rtc time updates to match the time of day (tod) alarm setting. this edge will set bit d0 of wake-up source 1 register. bit d0 will remain set and will only be reset on a read of wake- up source 1 register. if the wake-up source register is read before the clock has updated (i.e., rtc still equals the tod alarm) bit d0 is reset and stays reset until the next occurrence of a rtc_alrm wake-up event. note 3: access.bus interrupt - when access.bus = 1, a start condition or other event was detected on the access.bus bus wakeup source register 2 host n/a 8051 0x7f2b (r) power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w rrrrrrr r des. 1 = uart_ ri2 occurs 1 = uart_ ri1 occurs 1= wk_ee4 1 = wk_ee2 transition (both edges) 1 = wk_ee3 transition (both edges) 1 = htimer timeouts 1 = wk_hl6 active 1= ngpwk- up is active note: all the bits in this register are cleared on a read of this register. htimer interrupt -- when htimer=1, the hibernation timer counted down to ?0?. wakeup source register 3 host n/a
smsc ds ? FDC37N958FR page 166 rev. 09/01/99 8051 0x7f35 (r) power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 access rrrrrrrr host access n/a n/a n/a n/a n/a n/a n/a n/a des- cription reserved 0 reserved 0 reserved 0 reserved 0 reserved 0 1= wk_ hl8 is active 1= wk_ hl7 is active 1= wk_ anykey is active note: all the bits in this register are cleared on a read of this register. note 1: anykey wake-up (wk_anykey) - when unmasked, the wk_anykey will wake the 8051 from the sleep state when any of the keyboard scan in (ksi) pins goes low. the boolean equation below defines the wk_anykey function. wk_anykey = !(ksi0 & ksi1 & ksi2 & ksi3 & ksi4 & ksi5 & ksi6 & ksi7) note 2: ir receive activity wake-up events -- on the FDC37N958FR, gpio8 or irrx may be configured as an infared receive pin. an independently-maskable wake-up function is available on each of these pins. when un-masked, a high-to-low edge transition on either of these pins will generate an 8051 wake-up event. wakeup mask register 1 host n/a 8051 0x7f2c power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w description 1 = mask wk_hl 5 1 = mask wk_hl 2 1 = mask wk_hl 1 1 = mask ab_da tacce ss.bus 1 = mask wk_hl 3 1 = mask wk_hl 4 1 = mask wk_ee 1 1 = mask rtc_ alarm
smsc ds ? FDC37N958FR page 167 rev. 09/01/99 wakeup mask register 2 host n/a 8051 0x7f2d power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w des. 1 = mask uart ri2 1= mask uart_ ri1 1= mask wk_ee 4 1 = mask wk_ee 2 1 = mask wk_ee 3 1 = mask htimer 1 = mask wk_hl 6 1= mask ngpwk up wakeup mask register 3 host n/a 8051 0x7f36 power vcc1 default 0xff d7 d6 d5 d4 d3 d2 d1 d0 8051 access r/w r/w r/w r/w r/w r/w r/w r/w host access n/a n/a n/a n/a n/a n/a n/a n/a des- cription reserved 1 reserved 1 reserved 1 reserved 1 reserved 1 1 = mask wk_hl8 1 = mask wk_hl7 1 = mask wk_ anykey htimer register host n/a 8051 0x7ff3 power vcc1 default 0x00 hibernation timer - this 8 bit binary count-down timer can be programmed for from 30 seconds to 128 minutes in 30 second increments. when it expires (reaches ?0?), it stops (remains at ?0?) and causes a hardware event that will wake up the 8051. this timer is clocked by the 32 khz clock and is powered by vcc1. writing a non- zero value to this register starts the counter from that value.
smsc ds ? FDC37N958FR page 168 rev. 09/01/99 keyboard controller 8042 style host interface the universal keyboard controller uses the 80c51 microcontroller cpu core to produce a superset of the features provided by the industry-standard 8042 keyboard controller. added features include two high-drive serial interfaces, and additional interrupt sources. the FDC37N958FR provides an industry standard 8042-style host interface to the 80c51 to emulate standard 8042 keyboard controller and preserve software backward compatibility with the system bios. the fdc37c958?s keyboard isa interface is functionally compatible with the 8042-style host interface. it consists of the sd[0:7] data bus; the nior, niow and the kbd (keyboard) status register, kbd data/command write register, and kbd data read register. table 59 shows how the interface decodes the control signals. in addition to the above signals, the host interface includes keyboard and mouse irq's. table 59 - keyboard controller isa i/o address map isa address niow nior function (note 1, 2 ) 0x60 0 1 keyboard data write (c/d=0) 1 0 keyboard data read 0x64 0 1 keyboard command write (c/d=1) 1 0 keyboard status read all addresses are qualified by aen. note 1: the keyboard interface can be enabled or disabled through the configuration registers. note 2: these registers consist of three separate 8 bit registers: kbd status, kbd data/command write and kbd data read. keyboard data write this is an 8 bit write only register. when written, the c/d status bit of the status register is cleared to zero and the ibf bit is set. keyboard data read this is an 8 bit read only register. when read, the pbobf and/or auxobf interrupts are cleared and the obf flag in the status register is cleared. keyboard command write this is an 8 bit write only register. when written, the c/d status bit of the status register is set to one and the ibf bit is set. keyboard status read this is an 8 bit read only register. refer to the description of the status register (7ff2h) for more information. 8051-to-host keyboard communication the 8051 can write to the kbd data read register via address 7ff1h and 7ffah (aux host data register) respectively. a write to
smsc ds ? FDC37N958FR page 169 rev. 09/01/99 either of these addresses automatically sets bit 0 (obf) in the status register. a write to 7ff1h also sets pcobf. a write to 7ffah also sets auxobf1 . see table 60 below. table 60 - host-interface flags 8051 address flag 7ff1h (r/w) pcobf (kirq) output signal goes high 7ffah (w) auxobf1 (mirq) output signal goes high host i/f data register host isa 0x60 8051 0x7ff1 power vcc1 default n/a the input data register and output data register are each 8 bits wide. a write to this 8 bit register by the 8051 will load the keyboard data read buffer, set the obf flag and set the pcobf output if enabled. a read of this register by the 8051 will read the data from the keyboard data or command write buffer and clear the ibf flag. refer to the pcobf and status register descriptions for more information. host i/f command register host isa 0x64 (w) 8051 0x7ff1 power vcc1 default n/a the host cpu sends commands to the keyboard controller by writing command bytes to isa port 0x64.
smsc ds ? FDC37N958FR page 170 rev. 09/01/99 host i/f status register host isa 0x64 (r) 8051 0x7ff2 power vcc1 default n/a the status register is 8 bits wide. shows the contents of the kbd status register. table 61 - kbd status register d7 d6 d5 d4 d3 d2 d1 d0 ud ud auxobf/ud ud c/d ud ibf obf this register is read-only for the host and read/write by the 8051. the 8051 cannot write to bits 0, 1, or 3 of the status register. ud read/writeable by 8051. these bits are user-definable. c/d command data - this bit specifies whether the input data register contains data or a command (?0? = data, ?1? = command). during a host data/command write operation, this bit is set to "1" if sa2 = ?1? or reset to "0" if sa2 = 0. ibf input buffer full - this flag is set to ?1? whenever the host system writes data into the input data register. setting this flag activates the 8051's nibf interrupt if enabled. when the 8051 reads the input data register, this bit is automatically reset and the interrupt is cleared. there is no output pin associated with this internal signal. obf output buffer full - this flag is set to ?1? whenever the 8051 writes into the data registers at 7ff1h or 7ffah. when the host system reads the output data register, this bit is automatically reset. auxobf auxiliary output buffer full - this flag is set to ?1? whenever the 8051 writes into the data registers at 7ffah. this flag is reset to ?0? whenever the 8051 writes into the data registers at 7ff1h.
smsc ds ? FDC37N958FR page 171 rev. 09/01/99 pcobf host n/a 8051 0x7ffd power vcc1 default 0x00 refer to the pcobf description for information on this register. this is a ?1? bit register (bits 1-7=0 on read) host-to 8051 keyboard communication the host system can send both commands and data to the kbd data/command write register. the cpu differentiates between commands and data by reading the value of bit 3 of the status register. when bit 3 is "1", the cpu interprets the register contents as a command. when bit 3 is "0", the cpu interprets the register contents as data. during a host write operation, bit 3 is set to "1" if sa2 = 1 or reset to "0" if sa2 = 0. pcobf description (the following description assumes that obfen = 1 in configuration register 0); pcobf is gated onto kirq. the kirq signal is a system interrupt which signifies that the 8051 has written to the kbd data read register via address 7ff1h. on power-up, pcobf is reset to 0. pcobf will normally reflect the status of writes to 7ff1h, if pcobfen (bit 2 of configuration register ?0?) = ?0?. (kirq is normally selected as irq1 for keyboard support.) pcobf is cleared by hardware on a read of the host data register. additional flexibility has been added which allows firmware to directly control the pcobf output signal, independent of data transfers to the host-interface data output register. this feature allows the FDC37N958FR to be operated via the host "polled" mode. this firmware control is active when pcobfen = 1 and firmware can then bring pcobf high by writing a "1" to the lsb of the 1 bit data register, pcobf, allocated at 7ffdh. the firmware must also clear this bit by writing a "0" to the lsb of the 1 bit data register at 7ffdh. the pcobf register is also readable; bits 1-7 will return a "0" on the read back. the value read back on bit 0 of the register always reflects the present value of the pcobf output. if pcobfen = 1, then this value reflects the output of the firmware latch at 7ffdh. if pcobfen = 0, then the value read back reflects the in-process status of write cycles to 7ff1h (i.e., if the value read back is high, the host interface output data register has just been written to). if obfen=0, then kirq is driven inactive (low).
smsc ds ? FDC37N958FR page 172 rev. 09/01/99 auxobf1 description (the following description assumes that obfen = 1 in configuration register 0); this bit is multiplexed onto mirq. the auxobf1/mirq signal is a system interrupt which signifies that the 8051 has written to the output data register via address 7ffah. on power-up, after vcc1 por, auxobf1 is reset to 0. auxobf1 will normally reflects the status of writes to 7ffah. (mirq is normally selected as irq12 for mouse support.) auxobf1 is cleared by hardware on a read of the host data register. if obfen=0, then kirq is driven inactive (low). host i/f status register bits write to register auxobf (d5) obf (d0) obfen=0 obfen=1 7ff1 0 1 kirq=0 kirq=1 7ffa 1 1 mirq=0 mirq=1 obfen pcobfen 0 x kirq is inactive and driven low 10kirq = pcobf@7ff1 11kirq = pcobf@7ffd obfen auxh 0 x mirq is inactive and driven low 10mirq = pcobf@7ffa; status register d5 = user defined 11mirq = pcobf@7ffa; status register d5 = hardware controlled 8051 auxobf1 control register aux host data register host isa 0x60 8051 0x7ffa power vcc1 default n/a refer to the auxobf1 description for information on this register. gatea20 hardware speed-up gatea20 is multiplexed onto gpio[17] using misc6. the FDC37N958FR contains on-chip logic support for the gatea20 hardware speed- up feature. gatea20 is part of the control required to mask address line a20 to emulate 8086 addressing. in addition to the ability for the host to control the gatea20 output signal directly, a configuration bit called "saen" (software assist enable, bit 1 of configuration register 0) is provided; when set, saen allows firmware to control the gatea20 output. when saen is set, a 1 bit register assigned to address 7ffbh controls the gatea20 output. the register bit allocation is shown in table 62.
smsc ds ? FDC37N958FR page 173 rev. 09/01/99 table 62 - register bit allocation d7 d6 d5 d4 d3 d2 d1 d0 xxxxxxxgatea20 writing a "0" into location d0 causes the gatea20 output to go low, and vice versa. when the register at location 7ffbh is read, all unused bits (d7-d1) are read back as "0". host control and firmware control of gatea20 affect two separate register elements. read back of gatea20 through the use of 7ffbh reflects the present state of the gatea20 output signal: if saen is set, the value read back corresponds to the last firmware-initiated control of gatea20; if saen is reset, the value read back corresponds to the last host-initiated control of gatea20. host control of the gatea20 output is provided by the hardware interpretation of the "gatea20 sequence" (see table 61). the foregoing description assumes that the saen configuration bit is reset. when the FDC37N958FR receives a "d1" command followed by data (via the host interface), the on-chip hardware copies the value of data bit 1 in the received data field to the gatea20 host latch. at no time during this host-interface transaction will pcobf or the ibf flag (bit 1) in the status register be activated; i.e., this host control of gatea20 is transparent to firmware, with no consequent degradation of overall system performance. table 63 details the possible gatea20 sequences and the FDC37N958FR responses. on vcc1 por, gatea20 will be set. an additional level of control flexibility is offered via a memory-mapped synchronous set and reset capability. any data written to 7ffeh causes the gatea20 host latch to be set, while any data written to 7fffh causes it to be reset. this control mechanism should be used with caution. it was added to augment the "normal" control flow as described above, not to replace it. since the host and the firmware have asynchronous control capability of the host latch via this mechanism, a potential conflict could arise. therefore, after using the 7ffeh and 7fffh addresses, firmware should read back the gatea20 status via 7ffbh (with saen = 0) to confirm the actual gatea20 response.
smsc ds ? FDC37N958FR page 174 rev. 09/01/99 table 63 - gate20 command/data sequence examples sa2 r/w d [ 0:7 ] ibf gatea20 comments 1 0 1 w w w d1 df ff 0 0 0 q 1 1 gatea20 turn-on sequence 1 0 1 w w w d1 dd ff 0 0 0 q 0 0 gatea20 turn-off sequence 1 1 0 1 w w w w d1 d1 df ff 0 0 0 0 q q 1 1 gatea20 turn-on sequence(*) 1 1 0 1 w w w w d1 d1 dd ff 0 0 0 0 q q 0 0 gatea20 turn-off sequence(*) 1 1 1 w w w d1 xx** ff 0 1 1 q q q invalid sequence notes: all examples assume that the saen configuration bit is 0. "q" indicates the bit remains set at the previous state. *not a standard sequence. **xx = anything except d1. if multiple data bytes, set ibf and wait at state 0. let the software know something unusual happened. for data bytes sa2=0, only d[1] is used; all other bits are don't care.
smsc ds ? FDC37N958FR page 175 rev. 09/01/99 8051 gatea20 control registers gatea20 host n/a 8051 0x7ffb power vcc1 default 0x01 refer to the gatea20 hardware speed-up description for information on this register. this is a one bit register (bits 1-7=0 on read) setga20l host n/a 8051 0x7ffe (w) power vcc1 default n/a refer to the gatea20 hardware speed-up description for information on this register. a write to this register sets gatea20. rstga20l host n/a 8051 0x7fff (w) power vcc1 default n/a refer to the gatea20 hardware speed-up description for information on this register. a write to this register re-sets gatea20.
smsc ds ? FDC37N958FR page 176 rev. 09/01/99 64&naen sd[7:0] = d1 dff dfe naen&60 after d1 niow d sd[1] fast_gatea20 niow niow_dly niow_dly niow to kreset gen naen&64 niow naen&60 mux cpu_reset bit 1 enab_p92 alt_a20 a20 niow address gatea20 logic trailing edge delay dd1 sd[7:0] = ff sd[7:0] = fe data dd1 niow_dly niow 24mhz dd q q dq dq r r s any write any write vcc delay d nq r ibf bit rstga20l reg setga20l reg port92 reg 0 1 write gatea20 reg read gatea20 reg bit-0 bit-0 d0 d0 gatea20 saen bit-1 of config reg 0 saen q d ibf figure 16 - gatea20 implementation diagram cpu_reset hardware speed-up the alt_cpu_reset bit generates, under program control, the nalt_rst signal which provides an alternate means to drive the FDC37N958FR cpu_reset pin which in turn is used to reset the host cpu. the nalt_rst signal is internally nanded together with the nkbdreset pulse from the kreset speed up logic to provide an alternate software means of resetting the host cpu. note: before another nalt_rst pulse can be generated, alt_cpu_reset must be cleared to ?0? either by a system reset (reset_out asserted) or by a write to the port92 register with bit 0 = ?0?. an nalt_rst pulse is not generated in the event that the alt_cpu_reset bit is cleared and set before the prior nalt_reset pulse has completed.
smsc ds ? FDC37N958FR page 177 rev. 09/01/99 kreset pulse gen port92 reg pulse gen cpu_reset enab_p92 fe command bit 0 from kreset speed up logic nalt_rst saen 6us 14 us 6us 14 us figure 17 - cpu_reset implementation diagram
smsc ds ? FDC37N958FR page 178 rev. 09/01/99 port 92 the FDC37N958FR supports isa i/o writes to port 92h as a quick alternate mechanism for generating a cpu_reset pulse or controlling the state of gatea20. port 92 register description d7-d2 d1 d0 host r/w r/w r/w r/w bit def 0 reserved alt_gatea20 alt_cpu_reset the port92h register resides at isa address 0x92 and is used to support the alternate reset (nalt_rst) and alternate gatea20 (alt_a20) functions. this register defaults to 0x00 on assertion of reset_out or on vcc2 power on reset. the port92h register is enabled by setting the port 92 enable bit (bit 0 of logical device 7 configuration register 0xf0). when port92 is disabled, by clearing the port 92 enable bit, then access to this register is completely disabled (i/o writes to isa 92h are ignored and i/o reads float the system data bus sd[7:0]). when port92h is enabled the bits have the following meaning: d7-d2 reserved writes are ignored and reads return 0. d1 - alt_gatea20 this bit provides an alternate means for system control of the FDC37N958FR gatea20 pin. = 0: alt_a20 is driven low = 1: alt_a20 is driven high when port 92 is enabled, writing a 0 to bit 1 of the port92 register forces alt_a20 low. alt_a20 low drivesgatea20 low, if a20 from the keyboard controller is also low. when port 92 is enabled, writing a 1 to bit 1 of the port92 register forces alt_a20 high. alt_a20 high drives gatea20 high regardless of the state of a20 from the keyboard controller. d0 - alt_cpu_reset this bit provides an alternate means to generate a cpu_reset pulse. the cpu_reset output provides a means to reset the system cpu to effect a mode switch from protected virtual address mode to the real address mode. this provides a faster means of reset than is provided through the 8051 keyboard controller. writing a ?1? to this bit will cause the nalt_rst internal signal to pulse (active low) for a minimum of 6 " s after a delay of 14 " s. before another nalt_rst pulse can be generated, this bit must be written back to ?0?.
smsc ds ? FDC37N958FR page 179 rev. 09/01/99 direct keyboard scan the FDC37N958FR scanning keyboard controller is designed for intelligent keyboard management in computer applications. by properly configuring gpio4 and gpio5, the FDC37N958FR may be programmed to directly control keyboard interface matrixes of up to 16x8. keyboard scan-out register host n/a 8051 0x7f04 (w) power vcc1 default 0x20 d7-d6 d5 d4 d3 d2 d1 d0 8051 r/w w w w w w w w bit def n/a ksen 1 = forces all kso lines to go low d5 and d4 must be ?0? d[3:0] = 0000 kso[0] is asserted low d[3:0] = 0001 kso[1] is asserted low d[3:0] = 0010 kso[2] is asserted low d[3:0] = 0011 kso[3] is asserted low ! ! ! d[3:0] = 1101 kso[13] is asserted low d[3:0] = 1110 kso[14] is asserted low d[3:0] = 1111 kso[15] is asserted low ksen 1 = disable scanning of internal keyboard (all the ksout lines going high) (d4-d0 are don?t cares) 0 = enable scanning of internal keyboard note: to support kso14 and kso15, gpio4 and gpio5 must be configured properly. keyboard scan-in register host n/a 8051 0x7f04 (r) power vcc1 default n/a d7-d0 8051 r r bit description reflects the state of ksi [7:0] the value of the ksi[x] pins can be read through this register. the pin values are latched during the read.
smsc ds ? FDC37N958FR page 180 rev. 09/01/99 external keyboard and mouse interface industry-standard pc/at-compatible keyboards employ a two-wire, bidirectional ttl interface for data transmission. several sources also supply ps/2 mouse products that employ the same type of interface. to facilitate system expansion, the FDC37N958FR provides four pairs of signal pins that may be used to implement this interface directly for an external keyboard and mouse. the FDC37N958FR has four high-drive, open- drain output (external pull-ups are required), bidirectional port pins that can be used for external serial interfaces, such as isa external key-board and ps/2-type mouse interfaces. they are kbclk, kbdat, emclk, emdat, imclk, imdat, ps2clk and ps2dat. the following function is assumed to be in the ps/2 port logic: the serial clock lines, kbclk, emclk, imclk and ps2clk, are cleared to a low by vcc2 por. this is so that any power-on self-test completion code transmitted from the serial keyboard will not be missed by the FDC37N958FR due to power-up timing mismatches.
smsc ds ? FDC37N958FR page 181 rev. 09/01/99 mailbox register interface the FDC37N958FR provides a set of 16 8 bit registers, called mailbox registers, by which the host cpu may communicate with the 8051. these registers are accessible to the host in configuration mode or through the open mode index and data registers also described in configuration section. at the same time these registers are accessible to the 8051 through 16 memory mapped control registers. fourteen of these mailbox registers are general purpose and are typically used to pass status and parameters. the remaining two mailbox registers (mbox-0: system-to-8051, and mbox-1: 8051-to- system) are specifically designed to pass commands and to provide a means for each to interrupt the other assuming interrupts are unmasked. these registers are not ?dual- ported? meaning that the system bios and keyboard bios must be designed to properly share these registers. note: when the host cpu performs a write of the system-to-8051 mailbox register an 8051 int1 will be generated and seen by the 8051 if unmasked. when the 8051 writes to the system-to-8051 mailbox register the data is blocked but the write forces the system-to-8051 register to clear to ?0?, providing a means for the 8051 to inform that host that an operation has been completed. when the 8051 performs a write of the 8051-to- system mailbox register an smi may be generated and seen by the host if unmasked. when the host cpu writes to the 8051-to- system mailbox register the data is blocked but the write forces the 8051-to-system register to clear to zero, providing a means for the host to inform that 8051 that an operation has been completed. the protocol used to pass commands back and forth through the mailbox interface is left to the system designer. smsc can provide an application example of working code in which the host uses the mailboxes to gain access to all of the 8051 access only registers.
smsc ds ? FDC37N958FR page 182 rev. 09/01/99 figure 18 - mailbox block diagram register description system-to-8051 mailbox register 0 host idx 0x82 8051 0x7f08 (rc) power vcc1 default 0x00 rc = read only register is cleared upon a read. if enabled, an int1 will be generated when the system writes to this register. the interrupt source bit will be cleared when the 8051 reads this register. after reading this register the 8051 (8051) can clear the register?s content by a dummy write to this register to signal to the system that the register has been read. 8051-to-system mailbox register 1 host idx 0x83 (rc) 8051 0x7f09 power vcc1 default 0x00 if enabled by esmi register, an smi will be generated when the 8051 writes to this register. the smi interrupt will be cleared when the host reads this register. after reading this register the system can clear the register?s content by a dummy write to this register to signal to the 8051 that the register has been read. 14, 8 bit mailbox registers host cpu 8051 8051-to-system system-to-8051 smi int1
smsc ds ? FDC37N958FR page 183 rev. 09/01/99 mailbox register 2-f host idx 0x84 - 0x91 8051 0x7f0a - 0x7f17 power vcc1 default 0x00 these registers are readable and writeable from both the 8051 and the system. the system and the 8051 codes must make sure these registers are not inadvertently overwritten. mailbox smi interrupt the host can enable/disable smi interrupts generated as a result of the 8051 writing to mailbox register 1. the host can read the esmi source register to determine if the FDC37N958FR mailbox interface was the cause of the smi. esmi mask register host idx 0x97 (r) 8051 n/a power vcc2 default 0x00 d7-d4 d3 d2-d0 8051 r/w n/a n/a n/a system r/w r r/w r bit def reserved 1 = mask the 8051-to-system mailbox smi reserved esmi source register host idx 0x96 8051 n/a power vcc2 default 0x00 d7-d4 d3 d2-d0 8051 r/w n/a n/a n/a system r/w r r/w r bit def reserved 1 = 8051-to-system mailbox has been written to. this bit is cleared by a read of mailbox register 1 reserved
smsc ds ? FDC37N958FR page 184 rev. 09/01/99 ps/2 interface description ps/2 port control registers port 1 port 2 host n/a n/a 8051 0x7f41 0x7f49 power vcc2 vcc2 default 0x00 0x00 d7 d6 d5 d4 d3 d2 d1 d0 r/w r r r r/w r/w r/w r/w r/w ps/2 port1 reserved reserved reserved em_en kb_en inhibit rx_en tx_en ps/2 port2 reserved reserved reserved im_en ps2_en inhibit rx_en tx_en only one of bits 2-0 can be set to one. ps/2 port status registers port 1 port 2 host n/a n/a 8051 0x7f42 (r) 0x7f4a (r) power vcc2 vcc2 default 0x00 0x00 d7 d6 d5 d4 d3 d2 d1 d0 r/w r r r r rr rr ps/2 port1 reserved reserved em_busy kb_busy inhibit done em_drdy kb_drdy error ps/2 port2 reserved reserved im_busy ps2_busy inhibit done im_drdy ps2_drdy error
smsc ds ? FDC37N958FR page 185 rev. 09/01/99 ps/2 port error status registers port 1 port 2 host n/a n/a 8051 0x7f43 (r) 0x7f4b (r) power vcc2 vcc2 default 0x00 0x00 d7-d5d4d3d2d1d0 r/wrrrrrr bit def reserved parity res_timeout rec_timeout rts_timeout xmt_timeout ps/2 port tansmit registers port 1 port 2 host n/a n/a 8051 0x7f44 (w) 0x7f4c (w) power vcc2 vcc2 default 0x00 0x00 d7 d6 d5 d4 d3 d2 d1 d0 r/wwwwwwwww ps/2 port receive registers port 1 port 2 host n/a n/a 8051 0x7f45 (r) 0x7f4d (r) power vcc2 vcc2 default 0x00 0x00 d7 d6 d5 d4 d3 d2 d1 d0 rrrrrrrrr access.bus interface description the access.bus interface is fully and directly controlled by the on-chip 8051 through its set of on-chip memory mapped control registers. the access.bus logic is based on the pcf8584 i2c controller and is powered on the vcc1 powerplane to provide the ability to wake-up the 8051 on an access.bus event.
smsc ds ? FDC37N958FR page 186 rev. 09/01/99 memory mapped control registers access.bus control register host n/a 8051 0x7f31 (w) power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w w w w w w w w w bit def pin es0 reserved reserved eni sta sto ack bit 7 pin: pending interrupt not - writing this bit to a logic ?1? deasserts all status bits except for nbb (bus busy), nbb is not affected. this is a self-clearing bit. writing this bit to a logic ?0? has no effect. access.bus status register host n/a 8051 0x7f31 (r) power vcc1 default 0x81 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r r r r r r r r bit def pin 0 sts ber lrb aas lab nbb access.bus own address register host n/a 8051 0x7f32 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit def reserved slave address 6 slave address 5 slave address 4 slave address 3 slave address 2 slave address 1 slave address 0
smsc ds ? FDC37N958FR page 187 rev. 09/01/99 access.bus data register host n/a 8051 0x7f33 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w access.bus clock register host n/a 8051 0x7f34 power vcc1 default 0x00 access.bus clock d7 d6-d2 d1 d0 8051 r/w r/w r r/w r/w ab_rst* reserved 00 - clock off (default) 01 - 32 khz clock 10 - 8051 clock 11 - 24 mhz clock (*) access.bus reset, not self-clearing, must be written high and then written low. bit 7 ab_rst: (access.bus reset) setting this bit re-initializes all logic and registers in the access.bus block.
smsc ds ? FDC37N958FR page 188 rev. 09/01/99 table 64 - access.bus clock rates access. bus clock clock rate data rate nominal high nominal low minimum high d[1:0] 00 off 10 ring osc f/240 96/f 144/f 18/f ring osc=4 mhz 16.7 khz 24 " s36 " s4.5 " s ring osc=6 mhz 25 khz 16 " s24 " s3 " s ring osc=8 mhz 33.3 khz 12 " s18 " s2.25 " s 10 12 mhz 50 khz 8 " s12 " s4 " s 10 14.3 mhz 60 khz 6.7 " s 10.1 " s4 " s 10 16 mhz 67 khz 6 " s9 " s4 " s 11 24 mhz 100 khz 4 " s6 " s4 " s f = frequency of the ring oscillator.
smsc ds ? FDC37N958FR page 189 rev. 09/01/99 led controls the FDC37N958FR has three independent led outputs that are programmable under 8051 control. led register host n/a 8051 0x7f21 power vcc1 default see note 2 d7 d6 d5 d4 d3 d2 d1 d0 default 0 0 0 n/a 0 0 0 0 8051 access r/w r/w r/w r r/w r/w r/w r/w bit def fdd led enable fdd_ led1 fdd_l ed0 status of pin mode pwr_ led1 pwr_ led0 bat_ led1 bat_ led0 note 1 00 fdd led is off 01 led flash; p=1.0 sec 10 led flash; p=0.5 sec 11 led is fully on 00 pwr led is off 01 led flash; p=3.0 sec 10 led flash; p=1.5 sec 11 led is fully on 00 battery led is off 01 led flash; p=1.0 sec 10 led flash; p=0.5 sec 11 led is fully on note 1: d7 =1; fdd_led pin is controlled by d6, d5 d7=0; fdd_led is controlled by the motor enable 0 pin from the fdc. when motor enable 0 pin is asserted the led is on. led on time is t=125msec; ?0? is on, ?1? is off. period ?p? is indicated above. note 2: this register is impacted by a device functional revision. see functional revision addendum on page 308 for vcc1 and vcc2 por impact and default values. p t figure 19 - led output
smsc ds ? FDC37N958FR page 190 rev. 09/01/99 pulse width modulators the FDC37N958FR has two independent pulse width modulator outputs that are programmable under 8051 control. pwm0 register host idx 0x92 8051 0x7f25 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 0 = select 2 mhz 1 = select 3 mhz these 7 bits control the duty cycle of pin pwm0 (fan_spd) 0000000 = pin is low 0111111 = 50% duty cycle (32 " s on/ 32 us off if 2 mhz is used) 1111111 = pin is high for 127, low for 1 pwm1 register host idx 0x93 8051 0x7f26 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 0 = select 2 mhz 1 = select 3 mhz these 7 bits control the duty cycle of pin pwm1 0000000 = pin is low 0111111 = 50% duty cycle (32 " s on/ 32 us off if 2 mhz is used) 1111111 = pin is high for 127, low for 1 real time clock cmos access rtccntrl (rtc control) register host n/a 8051 0x7ff5 power vcc1 default 0x80
smsc ds ? FDC37N958FR page 191 rev. 09/01/99 the FDC37N958FR implements an interface that allows the 8051 to read/write the rtc and cmos registers. when reset_out is active or when vcc2 is off, the 8051 can read and write the cmos. d7 d6 d5 d4 d3 d2 d1 d0 nsh 0 0 0 kreqh hreqh kreql hreql nsh nsmart host - this bit is controlled by the 8051. when set to a ?1?, the host is not a smart host and does not recognize the sharing protocol. when set to a ?0?, the host is smart and can recognize the sharing protocol. when set to ?1?, this bit will clear hreqh and hreql. clearing this bit to ?0? will allow the 8051 to regain access to the cmos ram. kreql keyboard request low - this bit can be set by the 8051 when hreql is '0'. if the request is not granted, this bit is read back as a zero and the request must be tried again. note: after regaining control of the cmos, the 8051 must re-write the rtc address register before accessing the rtc data register. this bit selects access to the cmos ram addresses 0-7f. hreql host request low - this bit can be set by the host when kreql is ?0?. if the request is not granted, this bit is read back as a ?0? and the request must be tried again. kreqh keyboard request high - this bit can be set by the 8051 when hreqh is ?0? if the request is not granted, this bit is read back as a ?0? and the request must be tried again. note: after regaining control of the cmos, the 8051 must re-write the rtc address register before accessing the rtc data register. this bit selects access to the cmos ram addresses 80- ff. hreqh host request high - this bit can be set by the host when kreqh is ?0?. if the request is not granted, this bit is read back as a ?0? and the request must be tried again. nsh kreqx hreqx bus access 1xxhost 0 0 0 none 0 1 0 8051 001host
smsc ds ? FDC37N958FR page 192 rev. 09/01/99 rtc address register (high and low) host n/a 8051 0x7ff8 & 0x7ff6 power vcc1 default 0x00 & 0x00 the low register is used to provide the address for the first bank of 128 cmos ram registers and the high register is used to provide the address for the second bank of 128 cmos ram registers for a total of 256 registers. this register is used to select the cmos address when kreq=1. cmos register 7f is a control register that reflects the rtc control register and cannot be used as general purpose storage. bit d7 is not used for the address decode and is a don?t care bit. rtc data register (high and low) host n/a 8051 0x7ff9 & 0x7ff7 power vcc1 default 0x00 & 0x00 the low register is used to access the first bank of 128 bytes, in cmos ram the high register is used to access the second bank of 128 registers. this register is used to read or write the selected cmos register when kreq=1.
smsc ds ? FDC37N958FR page 193 rev. 09/01/99 8051 controlled parallel port to facilitate activities such as reprogramming the flash memory without opening the unit, the 8051 is able to take control of the parallel port interface. the 8051 has three memory mapped registers that look like the host?s standard parallel port registers (status, control, and data) with the exception that the 8051?s parallel port status register contains a write bit (bit 0) that allows the 8051 to disconnect the interface from the host and take control. refer to the parallel port section for more information. figure 20 - parallel port multiplexor sel 1 from/to host parallel port interface parallel port parallel port connector from/to 8051 parallel port interface pp_ha 1 0
smsc ds ? FDC37N958FR page 194 rev. 09/01/99 operation registers the 8051 uses the following three memory mapped registers to gain access to and control the parallel port interface. parallel port status register host n/a 8051 0x7f3a power vcc2 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w rrrrrrr r/w system r/w n/a n/a n/a n/a n/a n/a n/a n/a bit def nbusy nack pe slct nerr 0 0 pp_ha 1 = host (or fdc) controls the parallel port interface. 0 = 8051 controls the parallel port interface (default). if 8051 access to the parallel port pins is enabled; the level of the parallel port status pins can be read by reading this register. bit d7 (nbusy): reflects the inverse state of pin busy bit d6 (nack): reflects the current state of pin nack bit d5 (pe): reflects the current state of pin pe bit d4 (slct): represents the current state of pin slct bit d3 (nerr): reflects the current state of pin nerr
smsc ds ? FDC37N958FR page 195 rev. 09/01/99 parallel port control register host n/a 8051 0x7f3b power vcc2 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w system r/w n/a n/a n/a n/a n/a n/a n/a n/a bit def 0 0 pcd 0 slctin ninit autofd strobe if 8051 access to the parallel port pins is enabled. the value of strobe, autofd and slctin are inverted and output onto the parallel port control pins. the value of ninit is output onto the parallel port control pins. if pcd (parallel control direction) = 0, the data bus is output. if pcd = 1 the parallel port data bus is floating to allow read data in. parallel port data register host n/a 8051 0x7f3c power vcc2 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w system r/w n/a n/a n/a n/a n/a n/a n/a n/a bit def pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0 if 8051 access to the parallel port pins is enabled; when read, this register reads the logic levels on the parallel port pins.
smsc ds ? FDC37N958FR page 196 rev. 09/01/99 8051 controlled ir port it is possible to give direct control of the irrx and irtx pins to the 8051 by setting bit 2 of the multiplexing_1 register. the 8051 communicates to the pins through its memory mapped ir data register shown here. ir data register host idx 0x98 8051 n/a power vcc2 default 0x00 d7-d2 d1 d0 8051 r/w n/a n/a n/a system r/w r/w r r/w bit def reserved ir_rec ir_tx bit 1 and bit 0 are don?t care if bit 2 of the multiplexing_1 register is reset. (these bits are multiplexed onto the irtx and irrx pins when bit 2 of the multiplexing register is set).
smsc ds ? FDC37N958FR page 197 rev. 09/01/99 general purpose i/o (gpio) figure 21 - output pin type figure 22 - input pin type gpio out reg bit output en alt func control bit alt func output out pin 1 0 nrd nwr in reg bit in pin wake-up source bit nrd edge detector wake-up mask bit nwr wake-up irq gpio out reg bit gpio in reg bit gpio dir bit alt func control bit alt func output gpio pin 1 0 alt func input nrd nwr
smsc ds ? FDC37N958FR page 198 rev. 09/01/99 figure 23 - gpio pin type memory mapped control registers gpio direction register a host n/a 8051 0x7f18 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 bit def gpio7 1=output 0=input gpio6 1=out- put 0=input gpio5 1=out- put 0=input gpio4 1=out- put 0=input gpio3 1=out- put 0=input gpio2 1=out- put 0=input gpio1 1=out- put 0=input gpio0 1=out- put 0=input
smsc ds ? FDC37N958FR page 199 rev. 09/01/99 gpio input register a host n/a 8051 0x7f1a (r) power vcc1 default n/a d7 d6 d5 d4 d3 d2 d1 d0 bit des. status of pin gpio7 status of pin gpio6 status of pin gpio5 status of pin gpio4 status of pin gpio3 status of pin gpio2 status of pin gpio1 status of pin gpio0 gpio output register a host n/a 8051 0x7f19 power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 bit des. gpio7 gpio6 gpio5 gpio4 gpio3 gpio2 gpio1 gpio0 gpio direction register b host n/a 8051 0x7f1b power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 bit def. gpio15 1=out- put 0=input gpio14 1=out- put 0=input gpio13 1=out- put 0=input gpio12 1=out- put 0=input gpio11 1=out- put 0=input gpio10 1=out- put 0=input gpio9 1=out- put 0=input gpio8 1=out- put 0=input
smsc ds ? FDC37N958FR page 200 rev. 09/01/99 gpio output register b host n/a 8051 0x7f1c power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 bit def. gpio 15 gpio 14 gpio 13 gpio 12 gpio 11 gpio 10 gpio 9 gpio 8 gpio input register b host n/a 8051 0x7f1d (r) power vcc1 default n/a d7 d6 d5 d4 d3 d2 d1 d0 bit def. status of pin gpio15 status of pin gpio14 status of pin gpio13 status of pin gpio12 status of pin gpio11 status of pin gpio10 status of pin gpio9 status of pin gpio8 gpio direction register c host n/a 8051 0x7f1e power vcc1 default 0x00 on vcc2 por d7 d6 d5 d4 d3 d2 d1 d0 bit des. 00 gpio21 1=output 0=input gpio20 1=output 0=input gpio19 1=output 0=input gpio18 1=output 0=input gpio17 1=output 0=input gpio16 1=output 0=input
smsc ds ? FDC37N958FR page 201 rev. 09/01/99 gpio output register c host n/a 8051 0x7f1f power vcc1 default 0x00 on vcc2 por d7 d6 d5 d4 d3 d2 d1 d0 bit def. 0 0 gpio21 gpio20 gpio19 gpio18 gpio17 gpio16 gpio input register c host n/a 8051 0x7f20 (r) power vcc1 default n/a d7 d6 d5 d4 d3 d2 d1 d0 bit def. 0 0 status of pin gpio21 status of pin gpio20 status of pin gpio19 status of pin gpio18 status of pin gpio17 status of pin gpio16 out register d host n/a 8051 0x7f22 power vcc1 default 0xff on vcc2 por d7 d6 d5 d4 d3 d2 d1 d0 bit def. out7 out6 out5 out4 out3 out2 out1 out0
smsc ds ? FDC37N958FR page 202 rev. 09/01/99 out register e host n/a 8051 0x7f23 power vcc1 default 0x0f on vcc2 por d7 d6 d5 d4 d3 d2 d1 d0 bit def. 0 0 0 0 out11 out10 out9 out8 in register f host n/a 8051 0x7f24 (r) power vcc1 default n/a d7 d6 d5 d4 d3 d2 d1 d0 bit def. status of pin in7 status of pin in6 status of pin in5 status of pin in4 status of pin in3 status of pin in2 status of pin in1 status of pin in0
smsc ds ? FDC37N958FR page 203 rev. 09/01/99 multiplexed pins many of the FDC37N958FR?s gpio pins provide specific alternate functions which may be enabled by the 8051 firmware based on the design of the system in which the part will be used. list refer to the alternate function pin list on page 12 for a complete list of all of the FDC37N958FR multifunction pins. control registers the 8051 firmware controls the multiplexing functions for each of the multiplexed pins on the FDC37N958FR through the registers described in this section. multiplexing_1 register host n/a 8051 0x7f3d power vcc1 default 0x00 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit def misc7 misc6 misc5 misc4 misc3 misc2 misc1 misc0 pin misc0 = 0 (default) misc0 = 1 irq6 (fdc)/out0 out0 irq6 (fdc) nirq8/out1 out1 nirq8 irq7 (pp)/out2 out2 irq7 (pp) irq12 (mouse)/out3 out3 irq12(mouse) irq1(kbd)/out4 out4 irq1(kbd) nsmi/out7 out7 nsmi sirq/irq3 (ua1) sirq irq3 (ua1)
smsc ds ? FDC37N958FR page 204 rev. 09/01/99 misc[3,1] pin gpio[20] pin 52 pin gpio[21] pin 53 [0,0] (default) gpio[20] + 8051_rx * gpiio[21] [0,1] ps2clk ps2dat [1,0] gpio[20] + 8051_rx * 8051_tx ** [1,1] ps2clk ps2dat * gpio20_dir bit should be set to 0 when operating as an 8051_rx pin. ** gpio21_dir bit must be set to 1 when operating as an 8051_tx pin. the ps/2 pins on gpio20 and gpio21 are disabled (internally pulled high) when the non ps/2 alternate functions are selected. the ps/2 inputs under this condition are seen as a high to the ps/2 device interface logic. whenever a ps/2 channel is not enabled, the input signals to that channel must be high. the FDC37N958FR provides this through the use of weak pull-ups since the em and kb channels share a common receive path and the im and ps2 channels also share a common receive path. 1 0 pin 52 gpio20_dir misc1 ps2_clk_out gpio20_out gpio20_in ps2_clk_in 8051_rx figure 24 - gpio[20] alternate function structure
smsc ds ? FDC37N958FR page 205 rev. 09/01/99 1 0 pin 53 misc1 misc3 8051_tx gpio21_out gpio21_in ps2_dat_in 0 1 ps2_dat_out gpio21_dir figure 25 - gpio21 alternate function structure pin misc2 = 0 (default) misc2 = 1 irtx from ircc block from ir data register irrx from ircc block from ir data register pin misc4 = 0 (default) misc4 = 1 pwm0/out10 out10 pwm0 pwm1/out11 out11 pwm1 pin misc5 = 0 (default) misc5 = 1 out5 out5 nds1 out6 out6 nmtr1 pin misc6 = 0 (default) misc6 = 1 gpio[ 17] gpio[17] gatea20 pin misc7 = 0 (default) misc7 = 1 gpio[8] gpio[8] ircc block com-rx port gpio[9] gpio[9] ircc block com-tx port multiplexing_2 register host n/a 8051 0x7f40 power vcc1 default 0x00
smsc ds ? FDC37N958FR page 206 rev. 09/01/99 d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit def misc 16 misc 15 misc 14 misc 13 misc 12 misc 11 misc 10 misc 9 misc9 pin gpio[4] gpio[5] 0 (default) gpio[4] gpio[5] 1 kso14 kso15 misc17 misc10 misc6 pin out[8] (pin 202) pin kso12 (pin 23) 0 0 0 out8 kso12 0 0 1 cpu_reset kso12 0 1 x drq2 kso12 1 0 0 out8 out8 1 0 1 cpu_reset cpu_reset 1 1 0 drq2 out8 1 1 1 drq2 cpu_reset with this definition, only the pair [out8 & cpu_reset] can not simultaneously exist on pins 202 and 23.
smsc ds ? FDC37N958FR page 207 rev. 09/01/99 1 0 pin 202 misc10 misc6 cpu_reset drq2 misc17 kso12 0 1 out8 1 0 pin 23 figure 26 - pins 202 and 23 alternate function operation misc17 pin gpio18 (pin 207) pin kso13 (pin 22) 0 gpio18 + ndack2 (1) kso13 1 ndack2 gpio18 note 1: ndack2 can be received on in 207 when misc17 = 0 by setting gpio18?s dir bit to 0. pin 207 misc17 gpio18_dir kso13 gpio18_out 1 0 pin 22 ndack2 0 1 gpio18_in [ (m isc17=0) | (g pio 18_dir & m isc17=1) ] figure 27 - pin 207 and 22 alternate function operation misc11 pin out[9] pin gpio[19] 0 (default) out[9] gpio[19] 1 drq3 ndack3
smsc ds ? FDC37N958FR page 208 rev. 09/01/99 pin misc12 = 0 (default) misc12 = 1 gpio[11] gpio[11] ncts2 gpio[12] gpio[12] ndtr2 gpio[13] gpio[13] ndsr2 gpio[14] gpio[14] ndcd2 gpio[15] gpio[15] nri2 misc[14:13] = 0 (default) pin gpio[6] [0:0] (default) gpio[6] [0:1] ir_mode (ircc gp data) output [1:0] frx input [1:1] reserved misc[16:15] = 0 (default) pin gpio[10] [0:0] (default) gpio[10] [0:1] ir_mode (ircc gp data) output [1:0] frx input [1:1] nrts2 multiplexing_3 register host n/a 8051 0x7f30 power vcc1 default 0x00 d7 - d2 d1 d0 8051 r/w r r/w r/w bit def. reserved 0 misc17 misc8 note : originally bit 7 in the output enable register was defined as misc8, but this bit is now reserved. misc8 pin gpio[16] 0 (default) gpio[16] 1mid1 misc17 is described in the multiplexing_2 register section.
smsc ds ? FDC37N958FR page 209 rev. 09/01/99 real time clock general description the real time clock supercell (rtc) is a complete time of day clock with alarm and one hundred year calendar, a programmable periodic interrupt, and a programmable square wave generator. features ! counts seconds, minutes, and hours of the day. ! counts days of the week, date, month and year. ! binary or bcd representation of time, calendar and alarm. ! 24 hour daily alarm. port definition and description osc clock input pin - maximum clock frequency is 32.768 khz. db[0:7] in cpu data bus - all communication of data and control between the rtc db[0-7] out and the cpu are carried out over this data bus. a[0:7] the 8 address lines which select which internal register is to be accessed by any cpu operation. ncs low active block select - this input is low during any cpu cycle in which the rtc is to be accessed. (active for addresses 70h, 71h and 74h, 76h). nior cpu output data strobe - this port is a low whenever the cpu reads data from an internal rtc register. the nior low condition causes the contents of the addressed register to output its data onto the data bus. niow cpu write data strobe - the low to high transition of this port latches the contents of the data bus into the selected rtc register.
smsc ds ? FDC37N958FR page 210 rev. 09/01/99 isa i/o interface table 64 table 65 - rtc isa i/o address map isa address function (note 1) base (r/w) address register (70h/74h) base+1 (r/w) data register (71h/76h) all addresses are qualified by aen. note 1: the rtc can be enabled or disabled through the configuration registers. rtc address register writing to this register, sets the cmos address that will be read or written. port 70h (with rtc data register at 71h) addresses the first 128 cmos bytes and port 74h (with rtc data register at 76h) is for the next 128 cmos bytes. bit d7 is not used for the cmos ram address decoding (all eight bits are read/write). rtc data register a read of this register will read the contents of the selected cmos register. a write to this register will write to the selected cmos register (71h or 76h).
smsc ds ? FDC37N958FR page 211 rev. 09/01/99 vcc1 por the vcc1 por pin does not affect the clock calendar, or ram functions. when vcc1 por is active the following occurs: 1. periodic interrupt enable (pie) is cleared to ?0?. 2. alarm interrupt enable (aie) bit is cleared to ?0?. 3. update ended interrupt enable (uie) bit is cleared to ?0?. 4. update ended interrupt flag (uf) bit is cleared to ?0?. 5. interrupt request status flag (irqf) bit is cleared to ?0?. 6. periodic interrupt flag (pif) is cleared to ?0?. 7. the rtc and cmos registers are not accessable. 8. alarm interrupt flag (af) is cleared to ?0?. 9. nirq pin is in high impedance state. hostd the host disable pin, when active, prevents host access to the clock calendar, or ram functions (refer to the power management section). 8051d the 8051 disable pin, when active, prevents 8051 access to the clock calendar, or ram functions (refer to the power management section). ps the power-sense pin is used in the control of the valid ram and time (vrt) bit in register d. when the ps pin is low, the vrt bit is cleared to ?0?. as power is applied, the vrt bit remains low indicating that the contents of the ram, time registers and calendar are not guaranteed. ps must go high after powerup to allow the vrt bit to be set by a read of register d. this is an internal signal used to detect if both the main power and the battery power are both low at the same time. this is the only case where the contents of the ram, time registers and calendar are not valid. nirq the nirq pin is an active low output. the nirq output remains low as long as the status bit causing the interrupt is present and the corresponding interrupt-enable bit is set. reading register c or the vcc1 por pin clears the nirq pin.
smsc ds ? FDC37N958FR page 212 rev. 09/01/99 internal registers table 66 shows the address map of the rtc, ten bytes of time, calendar, and alarm data, four control and status bytes, 241 bytes of cmos registers and one rtc control register. table 66 - address map address register type register function 0 r/w register 0: seconds 1 r/w register 1: seconds alarm 2 r/w register 2: minutes 3 r/w register 3: minutes alarm 4 r/w register 4: hours 5 r/w register 5: hours alarm 6 r/w register 6: day of week 7 r/w register 7: date of month 8 r/w register 8: month 9 r/w register 9: year a r/w register a: b r/w register b: (bit 0 is read only) c r register c: d r register d: e-7f r/w general purpose (b2) 0-7e r/w bank 2: general purpose (b2) ff r/w bank 2: shared rtc control all 14 bytes are directly writable and readable by the host with the following exceptions: a. registers c and d are read only b. bit 7 of register a is read only c. bits 0 of register b is read only d. bits 7-1 of the shared rtc control register are read only
smsc ds ? FDC37N958FR page 213 rev. 09/01/99 time calendar and alarm the processor program obtains time and calendar information by reading the appropriate locations. the program may initialize the time, calendar and alarm by writing to these locations. the contents of the 10 time, calendar and alarm bytes can be in binary or bcd as shown in table 67. before initializing the internal registers, the set bit in register b should be set to a "1" to prevent time/calendar updates from occurring. the program initializes the 10 locations in the binary or bcd format as defined by the dm bit in register b. the set bit may then be cleared to allow updates. the 12/24 bit in register b establishes whether the hour locations represent 1 to 12 or 0 to 23. the 12/24 bit cannot be changed without reinitializing the hour locations. when the 12 hour format is selected, the high order bit of the hours byte represents pm when it is a "1". once per second, the 10 time, calendar and alarm bytes are switched to the update logic to be advanced by one second and to check for an alarm condition. if any of the 10 bytes are read at this time, the data outputs are undefined. the update cycle time is shown in table 67. the update logic contains circuitry for automatic end-of-month recognition as well as automatic leap year compensation. the three alarm bytes may be used in two ways. first, when the program inserts an alarm time in the appropriate hours, minutes and seconds alarm locations, the alarm interrupt is initiated at the specified time each day if the alarm enable bit is high. the second usage is to insert a "don't care" state in one or more of three alarm bytes. the "don't care" code is any hexadecimal byte from c0 to ff inclusive. that is the two most significant bits of each byte, when set to "1" create a "don't care" situation. an alarm interrupt each hour is created with a "don't care" code in the hours alarm location. similarly, an alarm is generated every minute with "don't care" codes in the hours and minutes alarm bytes. the "don't care" codes in all three alarm bytes create an interrupt every second.
smsc ds ? FDC37N958FR page 214 rev. 09/01/99 table 67 - rtc register valid range add register function bcd range binary range 0 register 0: seconds 00-59 00-3b 1 register 1: seconds alarm 00-59 00-3b 2 register 2: minutes 00-59 00-3b 3 register 3: minutes alarm 00-59 00-3b 4 register 4: hours 01-12 am 01-0c (12 hour mode) 81-92 pm 81-8c (24 hour mode) 00-23 00-17 5 register 5: hours alarm 01-12 am 01-0c (12 hour mode) 81-92 pm 81-8c (24 hour mode) 00-23 00-17 6 register 6: day of week 01-07 01-07 7 register 7: day of month 01-31 01-1f 8 register 8: month 01-12 01-0c 9 register 9: year 00-99 00-63 update cycle an update cycle is executed once per second if the set bit in register b is clear and the dv0-dv2 divider is not clear. the set bit in the "1" state permits the program to initialize the time and calendar bytes by stopping an existing update and preventing a new one from occurring. the primary function of the update cycle is to increment the seconds byte, check for overflow, increment the minutes byte when appropriate and so forth through to the year of the century byte. the update cycle also compares each alarm byte with the corresponding time byte and issues an alarm if a match or if a "don't care" code is present. the length of an update cycle is shown in table 68. during the update cycle the time, calendar and alarm bytes are not accessible by the processor program. if the processor reads these locations before the update cycle is complete the output will be undefined. the uip (update in progress) status bit is set during the interval. when the uip bit goes high, the update cycle will begin 244 " s later. therefore, if a low is read on the uip bit the user has at least 244 " s before time/calendar data will be changed.
smsc ds ? FDC37N958FR page 215 rev. 09/01/99 table 68 - rtc update cycle timing input clock frequency uip bit update cycle time minimum time before start of update cycle 32.768 khz 1 1948 " s - 32.768 khz 0 - 244 " s control and status registers the rtc has four registers which are accessible to the processor program at all times, even during the update cycle. register a (ah) b7 b6 b5 b4 b3 b2 b1 b0 uip dv2 dv1 dv0 rs3 rs2 rs1 rs0 uip the update in progress bit is a status flag that may be monitored by the program. when uip is a "1" the update cycle is in progress or will soon begin. when uip is a "0" the update cycle is not in progress and will not be for at least 244 " s. the time, calendar, and alarm information is fully available to the program when the uip bit is ?0?. the uip bit is a read only bit and is not affected by vcc1 por. writing the set bit in register b to a "1" inhibits any update cycle and then clears the uip status bit. dv2-0 three bits are used to permit the program to select various conditions of the 22 stage divider chain. table 68 shows the allowable combinations. the divider selection bits are also used to reset the divider chain. when the time/calendar is first initialized, the program may start the divider chain at the precise time stored in the registers. when the divider reset is removed the first update begins one-half second later. these three read/write bits are not affected by vcc1 por.
smsc ds ? FDC37N958FR page 216 rev. 09/01/99 table 69 - rtc divider selection bits oscillator register a bits frequency dv2 dv1 dv0 mode 32.768 khz 0 0 0 oscillator disabled 32.768 khz 0 0 1 oscillator disabled 32.768 khz 0 1 0 normal operate 32.768 khz 0 1 1 test 32.768 khz 1 0 x test 1 1 x reset divider rs3-0 the four rate selection bits select one of 15 taps on the divider chain or disable the divider output. the selected tap determines rate or frequency of the periodic interrupt. the program may enable or disable the interrupt with the pie bit in register b. table 70 lists the periodic interrupt rates and equivalent output frequencies that may be chosen with the rs0-rs3 bits. these four bits are read/write bits which are not affected by vcc1 por. table 70 - rtc periodic interrupt rates rate select 32.768 khz time base rs3 rs2 rs1 rs0 period rate of interrupt frequency of interrupt 0 0 0 0 0.0 0 0 0 1 3.90625 ms 256 khz 0 0 1 0 7.8125 ms 128 hz 0 0 1 1 122.070 " s 8.192 hz 0 1 0 0 244.141 " s 4.096 khz 0 1 0 1 488.281 " s 2.048 khz 0 1 1 0 976.562 " s 1.024 khz 0 1 1 1 1.953125 ms 512 hz 1 0 0 0 3.90625 ms 256 hz 1 0 0 1 7.8125 ms 128 hz 1 0 1 0 15.625 ms 64 hz 1 0 1 1 31.25 ms 32 hz 1 1 0 0 62.5 ms 16 hz 1 1 0 1 125 ms 8 hz 1 1 1 0 250 ms 4 hz 1 1 1 1 500 ms 2 hz
smsc ds ? FDC37N958FR page 217 rev. 09/01/99 register b (bh) b7 b6 b5 b4 b3 b2 b1 b0 set pie aie uie res dm 24/12 dse set when the set bit is a "0", the update functions normally by advancing the counts once-per-second. when the set bit is a "1", an update cycle in progress is aborted and the program may initialize the time and calendar bytes without an update occurring in the middle of initialization. set is a read/write bit which is not modified by vcc1 por or any internal functions. pie the periodic interrupt enable bit is a read/write bit which allows the periodic-interrupt flag (pf) bit in register c to cause the irqb port to be driven low. the program writes a "1" to the pie bit in order to receive periodic interrupts at the rate specified by the rs3 - rs0 bits in register a. a ?0? in pie blocks irqb from being initiated by a periodic interrupt, but the periodic flag (pf) is still set at the periodic rate. pie is not modified by any internal function, but is cleared to "0" by a vcc1 por. aie the alarm interrupt enable bit is a read/write bit, which when set to a "1" permits the alarm flag (af) bit in register c to assert irqb. an alarm interrupt occurs for each second that the three time bytes equal the three alarm bytes (including a "don't care" alarm code of binary 11xxxxxx). w hen the aie bit is a "0", the af bit does not initiate an irqb signal. the vcc1 por port clears aie to "0". the aie bit is not affected by any internal functions. uie the update-ended interrupt enable bit is a read/write bit which enables the update-end flag (uf) bit in register c to assert irqb. the vcc1 por port or the set bit going high clears the uie bit. res reserved - read as zero dm the data mode bit indicates whether time and calendar updates are to use binary or bcd formats. the dm bit is written by the processor program and may be read by the program, but is not modified by any internal functions or by vcc1 por. a "1" in dm signifies binary data, while a "0" in dm specifies bcd data. 24/12 the 24/12 control bit establishes the format of the hours byte as either the 24 hour mode if set to a "1", or the 12 hour mode if cleared to a "0". this is a read/write bit which is not affected by vcc1 por or any internal function. dse the daylight savings enable bit is read only and is always set to a "0" to indicate that the daylight savings time option is not available.
smsc ds ? FDC37N958FR page 218 rev. 09/01/99 register c (ch) - read only register b7 b6 b5 b4 b3 b2 b1 b0 irqf pf af uf 0 0 0 0 irqf the interrupt request flag is set to a "1" when one or more of the following are true: pf = pie = 1 af = aie = 1 uf = uie = 1 any time the irqf bit is a "1", the irqb signal is driven low. all flag bits are cleared after register c is read or by the vcc1 por port. pf the periodic interrupt flag is a read only bit which is set to a "1" when a particular edge is detected on the selected tap of the divider chain. the rs3 -rs0 bits establish the periodic rate. pf is set to a "1" independent of the state of the pie bit. pf being a "1" sets the irqf bit and initiates an irqb signal when pie is also a "1". the pf bit is cleared by vcc1 por or by a read of register c . af the alarm interrupt flag when set to a "1" indicates that the current time has matched the alarm time. a "1" in af causes a "1"to appear in irqf and the irqb port to go low when the aie bit is also a "1". a vcc1 por or a read of register c clears the af bit. uf the update-ended interrupt flag bit is set after each update cycle. when the uie bit is also a "1", the "1" in uf causes the irqf bit to be set and asserts irqb. a vcc1 por or a read of register c causes uf to be cleared. b3-0 the unused bits of register c are read as ?0? and cannot be written.
smsc ds ? FDC37N958FR page 219 rev. 09/01/99 register d (dh) read only register b7 b6 b5 b4 b3 b2 b1 b0 vrt0000000 vrt when a "1", this bit indicates that the contents of the rtc are valid. a "0" appears in the vrt bit when the battery voltage is low. the vrt bit is a read only bit which can only be set by a read of register d. refer to power management for the conditions when this bit is reset. the processor program can set the vrt bit when the time and calendar are initialized to indicate that the time is valid. b6 - b0 the remaining bits of register d are read as zeros and cannot be written. register eh-feh: general purpose registers eh-feh are general purpose "cmos" registers. these registers can be used by the host or 8051 and are fully available during the time update cycle. the contents of these registers are preserved by vcc0 power. registers eh-7eh are in bank one and registers 80h-feh are in bank 2. register 7fh, ffh: shared rtc control the FDC37N958FR implements an interface that allows the 8051 to read/write the rtc and cmos registers. refer to the keyboard controller section for the definition of these registers.
smsc ds ? FDC37N958FR page 220 rev. 09/01/99 interrupts the rtc includes three separate fully-automatic sources of interrupts to the processor. the alarm interrupt may be programmed to occur at rates from one-per-second to one-a-day. the periodic interrupt may be selected for rates from half-a-second to 122.070 " s. the update ended interrupt may be used to indicate to the program that an update cycle is completed. each of these independent interrupts are described in greater detail in other sections. the processor program selects which interrupts, if any, it wishes to receive by writing a "1" to the appropriate enable bits in register b. a "0" in an enable bit prohibits the irqb port from being asserted due to that interrupt cause. when an interrupt event occurs a flag bit is set to a "1" in register c. each of the three interrupt sources have separate flag bits in register c, which are set independent of the state of the corresponding enable bits in register b. the flag bits may be used with or without enabling the corresponding enable bits. the flag bits in register c are cleared (record of the interrupt event is erased) when register c is read. double latching is included in register c to ensure the bits that are set are stable throughout the read cycle. all bits which are high when read by the program are cleared, and new interrupts are held until after the read cycle. if an interrupt flag is already set when the interrupt becomes enabled, the irqb port is immediately activated, though the interrupt initiating the event may have occurred much earlier. when an interrupt flag bit is set and the corresponding interrupt-enable bit is also set, the irqb port is driven low. irqb is asserted as long as at least one of the three interrupt sources has its flag and enable bits both set. the irqf bit in register c is a "1" whenever the irqb port is being driven low. frequency divider the rtc has 22 binary divider stages following the clock input. the output of the divider is a 1 mhz signal to the update-cycle logic. the divider is controlled by the three divider bits (dv3-dv0) in register a. as shown in table 69 the divider control bits can select the operating mode, or be used to hold the divider chain reset which allows precision setting of the time. when the divider chain is changed from reset to the operating mode, the first update cycle is one-half second later. periodic interrupt selection the periodic interrupt allows the irqb port to be triggered from once every 500 ms to once every 122.07 " s. as table 70 shows, the periodic interrupt is selected with the rs0-rs3 bits in register a. the periodic interrupt is enabled with the pie bit in register b.
smsc ds ? FDC37N958FR page 221 rev. 09/01/99 power management the hostd signal controls all host bus inputs to the rtc and ram (niow, nior, vcc1 por). when asserted, it disallows any modification of the rtc and ram data by the host. hostd is asserted whenever: 1. v cc 2 is below 4.0 volts nominal 2. powergood is inactive and v cc 2 is above 4.0 volts nominal the 8051d signal controls all 8051 inputs to the rtc and ram. when asserted, it disallows any modification of the rtc and ram data by the 8051. 8051d is asserted whenever: 1. v cc 1 is below 2.5 volts nominal. 2. v cc 1 is above 2.5 volts and the 8051 is in its hardware initialization routine. the rtc (and cmos) always draws power from vcc0. when the v cc 2 voltage drops below 4.0 volts nominal, all host inputs are locked out so that the internal registers cannot be modified by the host system. this lockout condition continues for 500usec (min) to 1msec (max) after the vcc2 power has been restored. the timed lockout does not occur under the following conditions: 1. the divider chain controls (bits 6-4) are in any mode but normal operation ("010"). 2. the vrt bit is a "0". to minimize power consumption, the oscillator is not operational under the following conditions: 1. the divider chain controls (bits 6-4) are in oscillator disabled mode (000, or 001). 2. if vcc1=0 and the vcc0 is removed and the re-applied (a new battery is installed) the following occurs: a) the oscillator is disabled immediately. b) initialize all registers 00-0d to a ?00? when vcc1 is applied. note: there are three power supplies in the system vcc0, vcc1 and vcc2. vcc0 must be present before or at the same time as vcc1. vcc1 must be present before or at the same time as vcc2. the rtc and cmos registers always draw power from vcc0. vcc2 (nominal) power good battery voltage >2.5v host register access <4.0 x y n <4.0 to >4.0 0 y n >4.0 0->1 y timed lockout (note 1) >4.0 0 y n >4.0 1 y y note 1: if vcc2 and vcc1 are powered up at the same time, then the host register access is delayed by the timed lockout and the 8051 initialization, whichever is longer. vcc1 (nominal) vcc2 (nominal) 8051 initialization 8051 register access <2.5 x x n <2.5 to >2.5 x in init n >2.5 x in init n >2.5 x init finished y
smsc ds ? FDC37N958FR page 222 rev. 09/01/99 access.bus background the FDC37N958FR supports access.bus. access.bus is a serial communication protocol between a computer host and its peripheral devices. it provides a simple, uniform and inexpensive way to connect peripheral devices to a single computer port. a single access.bus on a host can accommodate up to 125 peripheral devices. the access.bus protocol includes a physical layer based on the i 2 c tm serial bus developed by philips, and several software layers. the software layers include the base protocol, the device driver interface, and several specific device protocols. for a description of the access.bus protocol, please refer to the access.bus specifications version 2.2, february 1994, available from the access.bus industry group (abig). the access.bus interface is based on the pcf8584 controller. the registers are mapped into the 8051?s external memory mapped register space. the addresses for the registers are shown in table 71. table 71 - access.bus register addresses address (note 1) access rights register 7f31h w control s1 7f31h r status s1 7f32h r/w own address s0? 7f33h r/w data s0 7f34h r/w (1) clock s2 note: these registers are only directly accessible by the 8051 and reside within the 8051?s external memory mapped data address space. note 1: bits 2 through 6 are read only reserved.
smsc ds ? FDC37N958FR page 223 rev. 09/01/99 register description the access.bus interface has four internal register locations. two of these, own address register s0? and clock register s2, are used for initialization of the chip. normally they are only written once directly after resetting of the chip. the other two registers, the data register s0, and the control/status register s1, (which functions as a double register) are used during actual data transmission/reception. register s0 performs all serial-to-parallel interfacing with the access.bus. register s1 contains access.bus status information required for bus access and/or monitoring. access.bus control/status register s1 the control/status register controls the access.bus operation and provides status information. this register has separate read and write functions for all bit positions. the write- only section provides register access control and control over access.bus signals, while the read-only section provides access.bus status information. access.bus control/status register s1: control d7 d6 d5 d4 d3 d2 d1 d0 r/w w w w w w w w w bit def pin es0 reserved reserved eni sta sto ack status d7 d6 d5 d4 d3 d2 d1 d0 r/w rr r r rrrr bit def pin 0 sts ber lrb aas lab nbb bit definitions register s1 control section the write-only section of s1 enables access to registers s0, s1 and s2, and also controls access.bus operation. bit 7 pin pending interrupt not. writing the pin bit to a logic ?1? deasserts all status bits except for the nbb (bus busy) - nbb is not affected. the pin bit is a self-clearing bit. writing this bit to a logic ?0? has no effect. this may serve as a software reset function. bit 6 eso enable serial output. eso enables or disables the serial access.bus i/o. when eso is high, access.bus communication is enabled; communication with serial shift register s0 is enabled and the s1 bus status bits are made available for reading. with eso = 0, bits eni, sta, sto and ack of s1 can be read for test purposes. bit 5 and 4 reserved bit 3 eni this bit enables the internal interrupt, nint, which is generated when the pin bit is active (logic 0). bit 2 and 1 sta and sto these bits control the generation of the access.bus start condition and transmission of slave address and r/nw bit, generation of repeated start condition, and generation of the stop condition (see table 72).
smsc ds ? FDC37N958FR page 224 rev. 09/01/99 table 72 - instruction table for serial bus control sta sto present mode function operation 1 0 slv/rec start transmit start+address, remain mst/trm if r/nw=0; go to mst/rec if r/nw=1. 1 0 mst/trm repeat start same as for slv/rec 0 1 mst/rec; mst/trm stop read; stop write transmit stop go to slv/rec mode; note 1 11 mst data chaining send stop, start and address after last master frame without stop sent; note 2 0 0 any nop no operation; note 3 note 1: in master receiver mode, the last byte must be terminated with ack bit high (?negative acknowledge?). note 2: if both sta and sto are set high simultaneously in master mode, a stop condition followed by a start condition + address will be generated. this allows ?chaining? of transmissions without relinquishing bus control. note 3: all other sta and sto mode combinations not mentioned in table 71 are nops.
smsc ds ? FDC37N958FR page 225 rev. 09/01/99 bit 0 ack this bit must be set normally to logic ?1?. this causes the access.bus to send an acknowledge automatically after each byte (this occurs during the 9th clock pulse). the bit must be reset (to logic ?0?) when the access.bus controller is operating in master/receiver mode and requires no further data to be sent from the slave transmitter. this causes a negative acknowledge on the access.bus, which halts further transmission from the slave device. register s1 status section the read-only section of s1 enables access to access.bus status information. bit 7 pin pending interrupt not. this bit is a status flag which is used to synchronize serial communication and is set to logic ?0? whenever the chip requires servicing. the pin bit is normally read in polled applications to determine when an access.bus byte transmission/reception is completed. when acting as transmitter, pin is set to logic ?1? (inactive) each time s0 is written. in receiver mode, the pin bit is automatically set to logic ?1? each time the data register s0 is read. after transmission or reception of one byte on the access.bus (nine clock pulses, including acknowledge) the pin bit will be automatically reset to logic ?0? (active) indicating a complete byte transmission/reception. when the pin bit is subsequently set to logic ?1? (inactive) all status bits will be reset to ?0? on a ber (bus error) condition. in polled applications, the pin bit is tested to determine when a serial transmission/reception has been completed. when the eni bit (bit 4 of write-only section of register s1) is also set to logic ?1? the hardware interrupt is enabled. in this case, the pi flag also triggers and internal interrupt (active low) via the nint output each time pin is reset to logic ?0?. when acting as a slave transmitter or slave receiver, while pin = ?0?, the chip will suspend access.bus transmission by holding the scl line low until the pin bit is set to logic ?1? (inactive). this prevents further data from being transmitted or received until the current data byte in s0 has been read (when acting as slave receiver) or the next data byte is written to s0 (when acting as slave transmitter). pin bit summary ! the pin bit can be used in polled applications to test when a serial transmission has been completed. when the eni bit is also set, the pin flag sets the internal interrupt via the nint output. ! in transmitter mode, after successful transmission of one byte on the access.bus the pin bit will be automatically reset to logic ?0? (active) indicating a complete byte transmission. ! in transmitter mode, pin is set to logic ?1? (inactive) each time register s0 is written. ! in receiver mode, pin is set to logic ?0? (inactive) on completion of each received byte. subsequently, the scl line will be held low until pin is set to logic ?1?. ! in receiver mode, when register s0 is read, pin is set to logic ?1? (inactive). ! in slave receiver mode, an access.bus stop condition will set pin=0 (active). ! pin=0 if a bus error (ber) occurs. bit 6 reserved , logic 0.
smsc ds ? FDC37N958FR page 226 rev. 09/01/99 bit 5 sts when in slave receiver mode, this flag is asserted when an externally generated stop condition is detected (used only in slave receiver mode). bit 4 ber bus error; a misplaced start or stop condition has been detected. resets nbb (to logic ?1?; inactive), sets pin = ?0? (active). bit 3 lrb/ad0 last received bit or address 0 (general call) bit. this status bit serves a dual function, and is valid only while pin=0: 1. lrb holds the value of the last received bit over the access.bus while aas=0 (not addressed as slave). normally this will be the value of the slave acknowledgment; thus checking for slave acknowledgment is done via testing of the lrb. 2. ado; when aas = ?1? (addressed as slave condition) the access.bus controller has been addressed as a slave. under this condition, this bit becomes the ad0 bit and will be set to logic ?1? if the slave address received was the ?general call? (00h) address, or logic ?0? if it was the access.bus controller?s own slave address. bit 2 aas addressed as slave bit. valid only when pin=0. when acting as slave receiver, this flag is set when an incoming address over the access.bus matches the value in own address register s0? (shifted by one bit) or if the access.bus ?general call? address (00h) has been received (?general call? is indicated when ad0 status bit is also set to logic ?1?). bit 1 lab lost arbitration bit. this bit is set when, in multi- master operation, arbitration is lost to another master on the access.bus. bit 0 nbb bus busy bit. this is a read-only flag indicating when the access.bus is in use. a zero indicates that the bus is busy, and access is not possible. this bit is set/reset (logic ?1?/logic ?0?) by start/stop conditions. own address register s0? when the chip is addressed as slave, this register must be loaded with the 7-bit access.bus address to which the chip is to respond. during initialization, the own address register s0? must be written to, regardless whether it is later used. the addressed as slave (aas) bit in status register s1 is set when this address is received (the value in s0 is compared with the value in s0?). note that the s0 and s0? registers are offset by one bit; hence, programming the own address register s0? with a value of 55h will result in the value aah being recognized as the chip?s access.bus slave address. after reset, s0? has default address 00h.
smsc ds ? FDC37N958FR page 227 rev. 09/01/99 access.bus own address register s0? own addr d7 d6 d5 d4 d3 d2 d1 d0 r/w r/w r/w r/w r/w r/w r/w r/w r/w bit def reserved slave address 6 slave address 5 slave address 4 slave address 3 slave address 2 slave address 1 slave address 0 data shift register s0 register s0 acts as serial shift register and read buffer interfacing to the access.bus. all read and write operations to/from the access.bus are done via this register. access.bus data is always shifted in or out of shift register s0. in receiver mode the access.bus data is shifted into the shift register until the acknowledge phase. further reception of data is inhibited (scl held low) until the s0 data shift register is read. in the transmitter mode data is transmitted to the access.bus as soon as it is written to the s0 shift register if the serial i/o is enabled (eso=1). access.bus data register data d7 d6 d5 d4 d3 d2 d1 d0 r/w r/w r/w r/w r/w r/w r/w r/w r/w clock register s2 register s2 controls the selection of the internal chip clock frequency used for the access.bus block. this determines the scl clock frequency generated by the chip. the selection is made via bits[2:0] (see table 73).
smsc ds ? FDC37N958FR page 228 rev. 09/01/99 access.bus clock register d7 d6-d2 d1 d0 8051 r/w r/w r r/w r/w ab_rst (note 1) reserved 00 - clock off (default) 01 - 32 khz clock 10 - 8051 clock 11 - 24 mhz clock (see table below) note 1: access.bus reset, not self-clearing, must be written high and then written low. bit 7 ab_rst: (access.bus reset) setting this bit re-initializes all logic and registers in the access.bus block. table 73 - internal clock rates and access.bus data rates access bus clock clock rate data rate nominal high nominal low minimum high d[1-0] 00 off 10 ring osc f/240 96/f 144/f 18/f ring osc=4 mhz 16.7 khz 24 " s36 " s4.5 " s ring osc=6 mhz 25 khz 16 " s24 " s3 " s ring osc=8 mhz 33.3 khz 12 " s18 " s2.25 " s 10 12mhz 50 khz 8 " s12 " s4 " s 10 14.3 mhz 60 khz 6.7 " s 10.1 " s4 " s 10 16 mhz 67 khz 6 " s9 " s4 " s 11 24 mhz 100 khz 4 " s6 " s4 " s f = frequency of the ring oscillator.
smsc ds ? FDC37N958FR page 229 rev. 09/01/99 ps/2 device interface ps/2 logic overview the FDC37N958FR has four ps/2 serial ports implemented in hardware which are directly controlled by the on chip 8051. the hardware implementation eliminates the need to bit bang i/o ports to generate ps/2 ports. the ps/2 logic allows the host to communicate to any serial auxiliary devices compatible with the ps/2 interface through any one of four ports : em, kb, im and ps2. there are two identical ps/2 channels, each containing a set of five operating registers. channel 1 (ps/2 port 1) consists of ports em and kb and channel 2 (ps/2 port 2) consists of ports im and ps2. each of the four ps/2 serial ports use a synchronous serial protocol to communicate with the auxiliary device. each ps/2 port has two signal lines : clock and data. both signal lines are bi-directional and imply open drain outputs. a pull-up resistor (typically 3.3k) is connected to the clock and data lines. this allows either the FDC37N958FR ps/2 logic or the auxiliary device to control both lines. regardless, the auxiliary device provides the clock for transmit and receive operations. the serial packet is made up of eleven bits, listed in order as they will appear on the data line : start bit, eight data bits (least significant bit first), odd parity, and stop bit. each bit cell is from 60 " s to 100 " s long. the data is latched on the high to low transition of the clock. transmitting to the remote auxiliary device the ps/2 serial protocol requires that the auxiliary device respond to all transmissions that it receives. the response will either be an 0xfa or 0xee. the response is stored in the ps/2 ports receive register. thus, after each transmission the receive register should contain either 0xfa or 0xee. note: refer to application note 6.19 for programmers details. receiving from the remote auxiliary device a port is set to receive by selecting the port and enabling the receiver. this is done by writing to the control register. the ps/2 logic floats the ps/2 port?s clock and data line when the port is selected to receive. the auxiliary device initiates the transfer by driving the data line low and 12 " s later driving the clock low. the FDC37N958FR ps/2 logic recognizes this as a start bit. the auxiliary device proceeds by transmitting ten more bits to the FDC37N958FR. the ps/2 logic latches the data on the high to low transition of the clock. after the stop bit, the ps/2 logic drives the clock line low until the receive register is read by the 8051. if there is no error in the transfer, the ps/2 logic sets the ready bit of the status register, clears the error bit of status register, and clears the error register. if, however, the receive operation does not complete in 2 ms, the error bit of the status register is set together with the rectimout bit of the error register, and the ready bit is not set. note: refer to application note 6.19 for programmers details.
smsc ds ? FDC37N958FR page 230 rev. 09/01/99 ps/2 emulation logic register operational description ps2 port control registers d7 d6 d5 d4 d3 d2 d1 d0 r/w r r r r/w r/w r/w r/w r/w ps/2 port1 reserved reserved reserved em_en kb_en inhibit rx_en tx_en ps/2 port2 reserved reserved reserved im_en ps2_en inhibit rx_en tx_en only one of bits d2-d0 can be set to ?1?. ps/2 port1 control register operation inhibit rx_en tx_en em_en kb_en operation status 0 0 1 0 1 transmission sent to keyboard, echo command received 0 0 1 1 0 transmission sent to extention mouse, echo command received 0 0 1 1 1 transmission inhibited, rts_timeout error, (illegal state) 0 1 0 0 1 data received from keyboard, transmission initiated by keyboard 0 1 0 1 0 data received from mouse, transmission initiated by mouse 0 1 0 1 1 data received from keyboard and mouse, transmissions are initiated by keyboard and mouse and interlaced to ps/2 port1 receive register 1 x x x x em and kb ps/2 interfaces are disabled. data written to the ps2 port1 transmit register is not transmitted and no data is received from the external mouse or keyboard
smsc ds ? FDC37N958FR page 231 rev. 09/01/99 the operation of the ps/2 port2 control register is similar for the im and ps/2 devices. ps/2 port status registers d7 d6 d5 d4 d3 d2 d1 d0 r/wrrrrrrrr ps/2 port1 reserved reserved em_busy kb_busy inhibit done em_drdy kb_drdy error ps/2 port2 reserved reserved im_busy ps2_ busy inhibit done im_drdy ps2_ drdy error error this bit is set in the event of a transmit or receive error condition on either the em or kb ps/2 ports or the im or ps/2 ports. the cause of the error can be determined by reading the ps/2 port1 or ps/2 port2 status register. kb_drdy this bit is set if if kb_en is set and a character has been received successfully from the ps/2 kb port. this bit is cleared when the data has been read from the ps/2 port1 receive register. em_drdy this bit is set if if em_en is set and a character has been received successfully from the ps/2 em port. this bit is cleared when the data has been read from the ps/2 port1 receive register. ps2_drdy this bit is set if if ps2_en is set and a character has been received successfully from the ps/2 ps2 port. this bit is cleared when the data has been read from the ps/2 port2 receive register. im_drdy this bit is set if if im_en is set and a character has been received successfully from the ps/2 im port. this bit is cleared when the data has been read from the ps/2 port2 receive register. inhibit done this bit is set when the inhibit bit of the control register is set. kb_busy this bit is set when the ps/2 kb port is actively receiving a character. em_busy this bit is set when the ps/2 em port is actively receiving a character. ps2_busy this bit is set when the ps/2 port is actively receiving a character. im_busy this bit is set when the ps/2 im port is actively receiving a character. note: on receive the busy bit is set while receiving the first data bit and cleared while receiving the parity bit. on transmit, the busy bit is not set at all.
smsc ds ? FDC37N958FR page 232 rev. 09/01/99 ps/2 port error status register 1 and 2 d7-d5 d4 d3 d2 d1 d0 r/w r r r r r r bit def reserved parity res_timeout rec_timeout rts_timeout xmt_timeout xmt_timeout (transmit_timeout) is set when the device fails to clock out a command within 2 ms of clocking out the start bit. rts_timeout (readytosend_timeout) is set when the device fails to start clocking out the command within 15 ms. rec_timeout (receiver_timeout) is set when the device does not finish sending a byte within 2 ms of sending the start bit. res_timeout (response_timeout) is set when the response to a command is not received within 32 ms. parity the ps/2 ports use odd parity, in the event of a receive parity error this bit is set. ps/2 port transmit regsiter 1 and 2 d7 d6 d5 d4 d3 d2 d1 d0 r/wwwwwwwww data written to the ps/2 port1/port2 transmit register is immediately transmitted onto the enabled ps/2 port 1/[port2] port provided that the ps/2 port1/[port2] inhibit bit is not set and that both ps/2 port1/[port2] devices are not enabled for transmit at the same time. ps/2 port receive register 1 and 2 d7 d6 d5 d4 d3 d2 d1 d0 rrrrrrrrr if kb_en, and/or em_en is set and ps/2 port1 rx_en is set any successfully received characters over the kb and/or the em ps/2 port are placed into this register and the em_drdy or kb_drdy ps/2 port1 status bit is set. similarly, if ps2_en and/or im_en is set and ps/2 port2 rx_en is set any successfully received characters over the ps2 and/or im ps2 ports are placed into this register and the ps2_drdy or im_drdy ps/2 port2 status bit is set.
smsc ds ? FDC37N958FR page 233 rev. 09/01/99 serial interrupts msio will support the serial interrupt scheme, which is adopted by several companies, to transmit interrupt information to the system. the serial interrupt scheme adheres to the serial irq specification for pci systems version 6.0. timing diagrams for irqser cycle pciclk = 33 mhz_in pin irqser = sirq pin a) start frame timing with source sampled a low pulse on irq1 rtsrt s irqser pciclk host controller irq1 irq1 drive source rt none irq0 frame irq1 frame srt irq2 frame none start start frame h sl or h 1 figure 28 - serial interrupts waveform ?start frame? h=host control sl=slave control r=recovery t=turn-around s=sample 1) start frame pulse can be 4-8 clocks wide.
smsc ds ? FDC37N958FR page 234 rev. 09/01/99 b) stop frame timing with host using 17 irqser sampling period figure 29 - serial interrupt waveform ?stop frame? h=host control r=recovery t=turn-around s=sample i= idle 1) stop pulse is two clocks wide for quiet mode, three clocks wide for continuous mode. 2) there may be none, one or more idle states during the stop frame. 3) the next irqser cycle?s start frame pulse may or may not start immediately after the turn-around clock of the stop frame. srts irqser pciclk host controller irq15 driver rt none irq14 irq15 srt iochck# none stop rt stop frame h i start next cycle 1 2 3 frame frame frame
smsc ds ? FDC37N958FR page 235 rev. 09/01/99 irqser cycle control there are two modes of operation for the irqser start frame. quiet (active) mode any device may initiate a start frame by driving the irqser low for one clock, while the irqser is idle. after driving low for one clock the irqser must immediately be tri-stated without at any time driving high. a start frame may not be initiated while the irqser is active. the irqser is idle between stop and start frames. the irqser is active between start and stop frames. this mode of operation allows the irqser to be idle when there are no irq/data transitions which should be most of the time. once a start frame has been initiated the host controller will take over driving the irqser low in the next clock and will continue driving the irqser low for a programmable period of three to seven clocks. this makes a total low pulse width of four to eight clocks. finally, the host controller will drive the irqser back high for one clock then tri-state. any irqser device (i.e., the fdc37c958) which detects any transition on an irq/data line for which it is responsible must initiate a start frame in order to update the host controller unless the irqser is already in an irqser cycle and the irq/data transition can be delivered in that irqser cycle. continuous (idle) mode only the host controller can initiate a start frame to update irq/data line information. all other irqser agents become passive and may not initiate a start frame. irqser will be driven low for four to eight clocks by host controller. this mode has two functions. it can be used to stop or idle the irqser or the host controller can operate irqser in a continuous mode by initiating a start frame at the end of every stop frame. an irqser mode transition can only occur during the stop frame. upon reset, irqser bus is defaulted to continuous mode, therefore only the host controller can initiate the first start frame. slaves must continuously sample the stop frames pulse width to determine the next irqser cycle?s mode. irqser data frame once a start frame has been initiated, the FDC37N958FR will watch for the rising edge of the start pulse and start counting irq/data frames from there. each irq/data frame is three clocks: sample phase, recovery phase, and turn-around phase. during the sample phase, the FDC37N958FR must drive the irqser (sirq pin) low, if and only if, its last detected irq/data value was low. if its detected irq/data value is high, irqser must be left tri- stated. during the recovery phase the FDC37N958FR must drive the serirq high, if and only if, it had driven the irqser low during the previous sample phase. during the turn- around phase the FDC37N958FR must tri-state the serirq. the FDC37N958FR will drive the irqser line low at the appropriate sample point if its associated irq/data line is low, regardless of which device initiated the start frame. the sample phase for each irq/data follows the low to high transition of the start frame pulse by a number of clocks equal to the irq/data frame times three, minus one (e.g. the irq5 sample clock is the sixth irq/data frame, (6 x 3) - 1 = 17th clock after the rising edge of the start pulse).
smsc ds ? FDC37N958FR page 236 rev. 09/01/99 table 74 - irqser sampling periods irqser period signal sampled # of clocks past start 1 not used 2 2irq1 5 3 nsmi/irq2 8 4irq3 11 5irq4 14 6irq5 17 7irq6 20 8irq7 23 9irq8 26 10 irq9 29 11 irq10 32 12 irq11 35 13 irq12 38 14 irq13 41 15 irq14 44 16 irq15 47 the sirq data frame will now support irq2 from a logical device; previously irqser period 3 was reserved for use by the system management interrupt (nsmi). when using period 3 for irq2 the user should mask off the FDC37N958FR?s smi via the esmi mask register. likewise, when using period 3 for nsmi, the user should not configure any logical devices as using irq2. irqser period 14 is used to transfer irq13. logical devices 0 (fdc), 3 (par port), 4 (ser port 1), 5 (ser port 2), 6 (rtc), and 7 (kbd) will have irq13 as a choice for their primary interrupt. stop cycle control once all irq/data frames have completed the host controller will terminate irqser activity by initiating a stop frame. only the host controller can initiate the stop frame. a stop frame is indicated when the irqser is low for two or three clocks. if the stop frame?s low time is two clocks then the next irqser cycle?s sampled mode is the quiet mode; and any irqser device may initiate a start frame in the second clock or more after the rising edge of the stop frame?s pulse. if the stop frame?s low time is three clocks, then the next irqser cycle?s sampled mode is the continuous mode, and only the host controller may initiate a start frame in the second clock or more after the rising edge of the stop frame?s pulse. latency latency for irq/data updates over the irqser bus in bridge-less systems with the minimum irq/data frames of seventeen will range up to 96 clocks (3.84 " s with a 25 mhz pci bus or 2.88 " s with a 33 mhz pci bus). if one or more pci to pci bridge is added to a system, the latency for irq/data updates from the secondary or tertiary buses will be a few clocks longer for synchronous buses, and approximately double for asynchronous buses. eoi/isr read latency any serialized irq scheme has a potential implementation issue related to irq latency. irq latency could cause an eoi or isr read to precede an irq transition that it should have followed. this could cause a system fault. the host interrupt controller is responsible for ensuring that these latency issues are mitigated. the recommended solution is to delay eois and isr reads to the interrupt controller by the same amount as the irqser cycle latency in order to ensure that these events do not occur out of order.
smsc ds ? FDC37N958FR page 237 rev. 09/01/99 ac/dc specification issue all irqser agents must drive/sample irqser synchronously related to the rising edge of the pci bus clock. irqser (sirq) pin uses the electrical specification of the pci bus. electrical parameters will follow the pci specification section 4, sustained tri-state. reset and initialization the irqser bus uses npcirst as its reset signal (npcirst is equivalent to using nreset_out) and follows the pci bus reset mechanism. the irqser pin is tri-stated by all agents while npcirst is active. with reset, irqser slaves and bridges are put into the (continuous) idle mode. the host controller is responsible for starting the initial irqser cycle to collect system?s irq/data default values. the system then follows with the continuous/quiet mode protocol (stop frame pulse width) for subsequent irqser cycles. it is the host controller?s responsibility to provide the default values to the 8259?s and other system logic before the first irqser cycle is performed. for irqser system suspend, insertion, or removal application, the host controller should be programmed into continuous (idle) mode first. this is to guarantee irqser bus is in idle state before the system configuration changes.
smsc ds ? FDC37N958FR page 238 rev. 09/01/99 FDC37N958FR configuration overview the configuration of the FDC37N958FR is very flexible and is based on the configuration architecture implemented in typical plug-and- play components. reference documents 1. the FDC37N958FR is designed for motherboard designs in which the resources required by their components are known. with its flexible resource allocation architecture, the FDC37N958FR allows the bios to assign resources at post. configuration elements primary configuration address decoder the logical devices are configured through two configuration i/o ports (index and data). the bios uses these configuration ports to initialize the logical devices at post. the mode pin is a hardware configuration pin. the mode pin sets the configuration port?s default base address. note: all i/o addresses are qualified with aen. table 75 - configuration access port port name mode pin = 0 (10k pull- down resistor or tie to gnd) mode pin = 1 (10k pull-up resistor or tie to vcc1) type config port 0x03f0 0x0370 write (nows isa i/o) index port 0x03f0 0x0370 read/write (nows isa i/o) data port index port + 1 read/write (nows isa i/o) the index and data ports are effective only when the chip is in the configuration state.
smsc ds ? FDC37N958FR page 239 rev. 09/01/99 typical sequence of configuration operation 1. at vcc2 power-up, all logical device configuration registers are set to their internal default state. 2. the chip enters the run state, and is ready to be placed into configuration state. 3. place the chip into the configuration state. once the chip enters into the configuration state the auto config ports are enabled. 4. the system sets the logical device information and activates desired logical devices through the chips index and data ports. 5. the system sends other commands. 6. exit the configuration state. the chip returns to the run state. note: only two states are defined, run and configuration. in the run state the chip will always be ready to enter the configuration state.
smsc ds ? FDC37N958FR page 240 rev. 09/01/99 entering the configuration state the device enters the configuration state when the following config key is successfully written to the config port. config key = < 0x55> exiting the configuration state the device exits the configuration state when the following config key is successfully written to the config port address. config key = < 0xaa> open mode configuration access logical device 7 contains a set of registers which may be accessed even when the FDC37N958FR is not in configuration state. accessing these configurations registers from the run state is called ?open mode configuration address?. the host cpu is provided a choice of four pairs of relocatable registers which are used to access these open mode registers. the host can use the default set or it can select a different set by programming the index address global configuration register bits[1-0]. these bits set the base i/o address for the open mode index and data register pairs. when set, bit 7 of the index address global configuration register enables open mode access to the select set of logical device 7 configuration registers. when cleared, bit 7 disables open mode access. for details on the set of open mode registers, see the open mode registers section. accessing configuration registers table 76 - FDC37N958FR configuration register access methods state mode pin index address configuration register (global config reg 0x03) config index register config data register open mode index register* open mode data register* bit 7 bit 1 bit 0 config 0 x x x 3f0 3f1 n/a n/a 1 x x x 370 371 n/a n/a run x 0 x x n/a n/a n/a n/a x 1 0 0 n/a n/a 0xe0 0xe1 x 1 0 1 n/a n/a 0xe2 0xe3 x 1 1 0 n/a n/a 0xe4 0xe5 x 1 1 1 n/a n/a 0xea 0xeb * open mode data registers are a subset of the configuration registers and are defined as registers 0x82 - 0x9a of logical device 7. loading a value outside of the address range (0x82-0x9a) into the open mode index register will effectively disable reads/writes of the open mode data register.
smsc ds ? FDC37N958FR page 241 rev. 09/01/99 configuration registers note: hard reset = vcc2 por or reset_out pin asserted. soft reset = configuration control register bit 0 set to a one by the host only. configuration register map table 77 - configuration register map index type hard reset soft reset configuration register global configuration registers 0x02 w 0x00 0x00 config control 0x03 r/w 0x01 or 0x02, based on mode pin n/a index address 0x07 r/w 0x00 0x00 logical device number 0x20 r 0x09 0x09 device id 0x21 r (4) (4) device rev - hard wired 0x22 r/w 0x00 n/a power control 0x23 r/w 0x00 n/a power management 0x24 r/w 0x04 n/a osc 0x25 r/w 0x00 n/a device mode 0x2c r/w 0x00 n/a test 0 0x2d r/w 0x00 (3) n/a test 1 0x2e r/w 0x00 (3) n/a test 2 0x2f r/w 0x00 n/a test 3 logical device 0 configuration registers (fdc) 0x30 r/w 0x00 0x00 activate 0x60, 0x61 r/w 0x03, 0xf0 0x03, 0xf0 primary base i/o address 0x70 r/w 0x06 0x06 primary interrupt select 0x74 r/w 0x02 0x02 dma channel select 0xf0 r/w 0x0e n/a fdd mode register 0xf1 r/w 0x00 n/a fdd option register 0xf2 r/w 0xff n/a fdd type register
smsc ds ? FDC37N958FR page 242 rev. 09/01/99 index type hard reset soft reset configuration register 0xf4 r/w 0x00 n/a fdd0 0xf5 r/w 0x00 n/a fdd1 logical device 1 configuration registers (reserved) logical device 2 configuration registers (reserved) logical device 3 configuration registers (parallel port) 0x30 r/w 0x00 0x00 activate 0x60, 0x61 r/w 0x00, 0x00 0x00, 0x00 primary base i/o address 0x70 r/w 0x00 0x00 primary interrupt select 0x74 r/w 0x04 0x04 dma channel select 0xf0 r/w 0x3c n/a parallel port mode register 0xf1 r/w 0x00 n/a parallel port cnfgb shadow register logical device 4 configuration registers (serial port 1) 0x30 r/w 0x00 0x00 activate 0x60, 0x61 r/w 0x00, 0x00 0x00, 0x00 uart register base i/o address 0x70 r/w 0x00 0x00 primary interrupt select 0xf0 r/w 0x00 n/a serial port 1 mode register logical device 5 configuration registers (serial port 2) 0x30 r/w 0x00 0x00 activate 0x60, 0x61 r/w 0x00, 0x00 0x00, 0x00 primary base i/o address 0x62, 0x63 r/w 0x00, 0x00 0x00, 0x00 usrt register base i/o address 0x74 r/w 0x04 0x04 ircc dma channel select 0xf1 r/w 0x02 n/a ir options register 0xf2 r/w 0x03 n/a ir half duplex timeout 0x70 r/w 0x00 0x00 primary interrupt select 0xf0 r/w 0x00 n/a serial port 2 mode register
smsc ds ? FDC37N958FR page 243 rev. 09/01/99 index type hard reset soft reset configuration register 0xf1 r/w 0x00 n/a ir options register logical device 6 configuration registers (rtc) 0x30 r/w 0x00 0x00 activate 0x70 r/w 0x00 0x00 primary interrupt select 0xf0 r/w 0x00 n/a real time clock mode register logical device 7 configuration registers (keyboard) 0x30 r/w 0x00 0x00 activate 0x70 r/w 0x00 0x00 primary interrupt select 0x72 r/w 0x00 0x00 second interrupt select 0x82 (1) r/w (2) n/a system-to-8051 mailbox register 0x83 r/w (2) n/a 8051-to-system mailbox register 0x84 r/w (2) n/a mailbox register 2 0x85 r/w (2) n/a mailbox register 3 0x86 r/w (2) n/a mailbox register 4 0x87 r/w (2) n/a mailbox register 5 0x88 r/w (2) n/a mailbox register 6 0x89 r/w (2) n/a mailbox register 7 0x8a r/w (2) n/a mailbox register 8 0x8b r/w (2) n/a mailbox register 9 0x8c r/w (2) n/a mailbox register a 0x8d r/w (2) n/a mailbox register b 0x8e r/w (2) n/a mailbox register c 0x8f r/w (2) n/a mailbox register d 0x90 r/w (2) n/a mailbox register e 0x91 r/w (2) n/a mailbox register f 0x92 r/w (2) n/a pwm0 register 0x93 r/w (2) n/a pwm1 register
smsc ds ? FDC37N958FR page 244 rev. 09/01/99 index type hard reset soft reset configuration register 0x94 r/w (2) n/a 8051stp_clk 0x95 r/w (2) n/a hmem 0x96 r/w (2) n/a esmi source register 0x97 r/w (2) n/a esmi mask register 0x98 r/w (2) n/a ir data register 0x99 r/w (2) n/a force disk change register 0x9a r (2) n/a floppy data rate select shadow register 0x9b r (2) n/a uart1 fifo control shadow register 0x9c r (2) n/a uart2 fifo control shadow register 0xf0 r/w 0x00 0x00 krst_ga20 register note 1: registers 0x82 through 0x9a of logical device 7 (kbd/8051 cpu) are also accessible when the FDC37N958FR device is not in configuration state. when in configuration state, the host first sets the logical device # register to 0x07 and then uses the index and data ports to indirectly access these registers. when not in configuration state, the host may simply use the index and data ports to access these registers regardless of the value currently stored in the logical device # register. note 2: refer to the FDC37N958FR keyboard specification for reset. note 3: reset only by vcc2 por. note 4: this register is impacted by a device functional revision. see functional revision addendum on page 308 for default values.
smsc ds ? FDC37N958FR page 245 rev. 09/01/99 chip level (global) control/configuration registers[0x00-0x2f] the chip-level (global) registers lie in the address range [0x00-0x2f]. the index port is used to select a configuration register in the chip. the data port is then used to access the selected register. these registers, with the exception of registers 0x82 through 0x9a of logical device 7, are accessible only in the configuration state. table 78 - global configuration registers register address description state chip (global) control registers 0x00 - 0x01 reserved, writes are ignored, reads return 0. config control 0x02 w the hardware automatically clears this bit after the write; there is no need for software to clear the bits. bit [0] = 1: soft reset; refer to table 77 for the soft reset value for each register. c index address 0x03w bit [7] when this bit is set to a ?1? bits[1:0] of this register will then determine the i/o base address for an index and data register used to access the open mode data registers (0x82-0x9a of logical device 7) when the FDC37N958FR is in the run state. =1 enable an index and data port to access the open mode data registers when in run state. =0 disable index port and data port to access open mode data registers when in the run state. (default on vcc2 por). bit[6] =1 enable config_stat port. =0 disable config_stat port (default on vcc2 por). bit[5-2] reserved - writes are ignored, reads return 0. bit[1-0] when in the run state these bits set the address of the index and data registers used to access the open mode data registers. =11 0xea =10 0xe4 (mode=1 vcc2 por default) =01 0xe2 (mode=0 vcc2 por default) =00 oxe0 0x04 - 0x06 reserved - writes are ignored, reads return 0.
smsc ds ? FDC37N958FR page 246 rev. 09/01/99 register address description state logical device # 0x07 r/w a write to this register selects the current logical device. this allows access to the control and configuration registers for each logical device. note: the activate command operates only on the selected logical device. c card level reserved 0x08 - 0x1f reserved - writes are ignored, reads return 0. chip-level, smsc defined device id hard wired 0x20 r a read-only register which provides device identification. bit[7-0] = 0x09 when read c device rev hard wired 0x21 r a read-only register which provides device revision information. this register is impacted by a device functional revision. see functional revision addendum on page 308 for default values. c powercontrol 0x22 r/w bit[0] fdc power bit[1:2] reserved (read as 0) bit[3] parallel port power bit[4] serial port 1 power bit[5] serial port 2 power bit[6:7] reserved (read as 0) =0 power off or disabled =1 power on or enabled c power mgmt 0x23 r/w bit[0] fdc bit[1:2] reserved (read as 0) bit[3] parallel port bit[4] serial port 1 bit[5] serial port 2 bit[6:7] reserved (read as 0) =0 power off or disabled =1 power on or enabled c osc 0x24 r/w bit[1:0] reserved, set to ?0? bit[3:2] osc =01 osc is on, brg clock is on when pwrgd is active, osc is off and brg clock is disabled (default) =10 same as above (01) case =00 osc is on, brg clock enabled =11 osc is off, btg clock is disabled bit[6:4] clk_out select =[0,0,0] clk_out = 1.8432 mhz =[0,0,1] clk_out = 14.318 mhz c
smsc ds ? FDC37N958FR page 247 rev. 09/01/99 register address description state =[0,1,0] clk_out = 16 mhz =[0,1,1] clk_out = 24 mhz =[1,0,0] clk_out = 48 mhz =[1,0,1] reserved =[1,1,x] reserved bit[7] nirq8 polarity =0 nirq8 is active high =1 nirq8 is active low note: this polarity bit not only affects the nirq8 pin, but is also reflected in the serial irq sample phase for the irq8 frame for the serial irq bus. device mode 0x25 r/w bit [1-0] flash timing this register is used to program the width of flash read (nfrd) and flash write (nfwr) signals during host flash accesses. = 0,0 : nfrd/nfwr width = 5 sclks = 0,1 : width = 4 sclks = 1,0 : width = 3 sclks = 1,1 : reserved, do not use. bit[2] serirq mode = 0 : slave can initiate a cycle. = 1 : only host initiates cycles. bit [4:3] parallel port fdc = [0:0] normal = [0:1] ppfd1 mode = [1:0] ppfd2 mode = [1:1] reserved bit [7:5] reserved - writes ignored, reads return ?0?. chip level vendor defined 0x26 reserved - writes are ignored, reads return 0. test registers 0x27-0x2b smsc test mode registers, reserved for smsc. test 0 0x2c test modes - reserved for smsc. users should not write to this register, may produce undesired results. test 1 0x2d r/w test modes : reserved for smsc. users should not write to this register; may produce undesired results. c
smsc ds ? FDC37N958FR page 248 rev. 09/01/99 register address description state test 2 0x2e r/w test modes - reserved for smsc. users should not write to this register; may produce undesired results. c test 3 0x2f r/w test modes - reserved for smsc. users should not write to this register; may produce undesired results. c
smsc ds ? FDC37N958FR page 249 rev. 09/01/99 logical device configuration/control registers [0x30-0xff] used to access the registers that are assigned to each logical unit. this chip supports six logical units and has six sets of logical device registers. the logical devices are floppy, parallel, serial 1 and serial 2, real time clock, and keyboard controller. a separate set (bank) of control and configuration registers exists for each logical device and is selected with the logical device # register (0x07). the index port is used to select a specific logical device register. these registers are then accessed through the data port. the logical device registers are accessible only when the device is in the configuration state with the exception of registers 0x82-0x9a of logical device 7 which are also accessible when in the run state. the logical register addresses are listed in table 79. table 79 - logical device configuration registers logical device register address description state activate (1) (0x30) bits[7:1] reserved, set to ?0?. bit[0] = 1 activates the logical device currently selected through the logical device # register. = 0 logical device currently selected is inactive. c logical device control (0x31-0x37) reserved - writes are ignored, reads return ?0?. c logical device control (0x38-0x3f) vendor defined - reserved - writes are ignored, reads return ?0?. c memory base address (0x40-0x5f) reserved - writes are ignored, reads return ?0?. c i/o base address (see table ) (0x60-0x6f) 0x60 = addr[15:8] 0x61= addr[7:0] all logical devices contain 0x60, 0x61. unused registers will ignore writes and return ?0? when read. c interrupt select (0x70,072) 0x70 is implemented for each logical device. refer to interrupt configuration register description. only the kybd controller uses interrupt select register 0x72. unused register (0x72) will ignore writes and return ?0? when read. interrupts default to edge high (isa compatible). c (0x71,0x73) reserved - not implemented. these register locations ignore writes and return ?0? when read.
smsc ds ? FDC37N958FR page 250 rev. 09/01/99 logical device register address description state dma channel select (0x74,0x75) only 0x74 is implemented for fdc , and parallel port. 0x75 is not implemented and ignores writes and returns ?0? when read. refer to dma channel configuration (seetable 79). c 32-bit memory space configuration (0x76-0xa8) reserved - not implemented. these register locations ignore writes and return ?0? when read. logical device (0xa9-0xdf) reserved - not implemented. these register locations ignore writes and return ?0? when read. c logical device configuration (0xe0-0xfe) reserved - vendor defined (see smsc defined logical device configuration registers). c reserved 0xff reserved c note1: a logical device will be active and powered up according to the following equation. device on (active) = (activate bit set and pwr/control bit set) and (8051 disable bit set) the logical device's activate bit and its pwr/control bit are linked such that setting or clearing one sets or clears the other. three bits in the 8051?s disable register (see keyboard spec), bits d7, d6 and d4 are capable of overriding the activate and pwr/control bit settings for logical devices 3, 4 and 0 respectivelely. thus clearing bit d7 of the disable register will disable the fdc regardless of the fdc?s activate and pwr/control bits. when d7 of the disable register is set, the fdc?s activate and pwr/control bits will determine the on/off state of the fdc. if the i/o base addr of the logical device is not within the base i/o range as shown in the logical device i/o map, then read or write is not valid and is ignored.
smsc ds ? FDC37N958FR page 251 rev. 09/01/99 i/o base address configuration register description table 80 - logical device, base i/o addresses logical device number logical device register index base i/o range (note 1) fixed base offsets 0x00 fdc 0x60,0x61 [0x100:0x0ff8] on 8 byte boundaries +0 : sra +1 : srb +2 : dor +3 : tsr +4 : msr/dsr +5 : fifo +7 : dir/ccr 0x01 reserved 0x02 reserved 0x03 parallel port 0x60,0x61 [0x100:0x0ffc] on 4 byte boundaries (epp not supported) or [0x100:0x0ff8] on 8 byte boundaries (all modes supported, epp is only available when the base address is on an 8-byte boundary) +0 : data | ecpafifo +1 : status +2 : control +3 : epp address * +4 : epp data 0 * +5 : epp data 1 * +6 : epp data 2 * +7 : epp data 3 * +400h : cfifo | ecpdfifo | tfifo | cnfga +401h : cnfgb +402h : ecr 0x04 serial port 1 0x60,0x61 [0x100:0x0ff8] on 8 byte boundaries +0 : rb/tb | lsb div +1 : ier | msb div +2 : iir/fcr +3 : lcr +4 : mcr +5 : lsr +6 : msr +7 : scr 0x05 serial port 2 (uart) 0x60,0x61 [0x100:0x0ff8] on 8 byte boundaries +0 : rb/tb | lsb div +1 : ier | msb div +2 : iir/fcr +3 : lcr +4 : mcr +5 : lsr +6 : msr +7 : scr
smsc ds ? FDC37N958FR page 252 rev. 09/01/99 logical device number logical device register index base i/o range (note 1) fixed base offsets 0x05 serial port 2 (ir-usrt) 0x62, 0x63 [0x100:0x0ff8] on 8 byte boundaries +0 : register block n, address 0 +1 : register block n, address 1 +2 : register block n, address 2 +3 : register block n, address 3 +4 : register block n, address 4 +5 : register block n, address 5 +6 : register block n, address 6 +7 : usrt master control reg. 0x06 rtc n/a not relocatable fixed base address bank 0 0x70 : address register 0x71 : data register * bank 1 0x74 : address register 0x71 : data register * 0x07 kybd n/a not relocatable fixed base address 0x60 : data register 0x64 : command/status reg. note 1: this chip uses all isa address bits to decode the base address of each of its logical devices. note*: when these registers are accessed the nnows line is not asserted. all other registers in this table assert the nnows signal when accessed.
smsc ds ? FDC37N958FR page 253 rev. 09/01/99 interrupt select configuration register description table 81 -interrupt select configuration registers name reg index definition state interrupt request level select 0 0x70 (r/w) bit [3-0] select which interrupt level is used for interrupt 0. 0x00=no interrupt selected. 0x01=irq1 0x02=irq2 ! ! ! 0x0e= irq14 0x0f= irq15 all pin-type interrupts are edge high (except ecp/epp). each logical device?s interrupts selected through this register physically select the interrupts to be used by the FDC37N958FR for either the serial irq interface or for the individual pin-type isa interrupts if selected. setting the irq through this register for the parallel port is not reflected in the enhanced parallel port cnfgb register, software must set the dma/irq bits in the parallel port logical device config register 0xf1 (parallel port cnfgb shadow register). it is possible for both uart1 and uart2 to share a common irq pin (refer to table 80 in the logical device 4 smsc defined configuration registers section). c note: an interrupt is activated by setting the interrupt request level select 0 register to a non-zero value and : 1. for the fdc logical device by setting dmaen, bit d3 of the digital output register. 2. for the pp logical device by setting irqe, bit d4 of the control port and in addition 3. for the pp logical device in ecp mode by clearing serviceintr, bit d2 of the ecr. 4. for the serial port logical device by setting any combination of bits d0-d3 in the ier and by setting the out2 bit in the uart's modem control (mcr) register. 5. for the rtc by (refer to the rtc section of this specification). 6. for the kybd by (refer to the kybd controller section of this specification). note: irq pins must tri-state if not used/selected by any logical device (refer to appendix a).
smsc ds ? FDC37N958FR page 254 rev. 09/01/99 dma channel select configuration register description table 82 - dma channel select cofiguration registers name reg index definition state dma channel select 0 0x74 (r/w) bit [2:0] select the dma channel. 0x00=dma0 0x01=dma1 0x02=dma2 0x03=dma3 0x04-0x07= no dma active c note: a dma channel is activated by setting the dma channel select 0 register to [0x00-0x03] and : 1. for the fdc logical device by setting dmaen, bit d3 of the digital output register 2. for the pp logical device in ecp mode by setting dmaen, bit d3 of the ecr 3. for the uart2 logical device, by setting the dma enable bit. refer to the ircc specification available from smsc note: dmareq pins must tri-state if not used/selected by any logical device. refer to appendix a of this section.
smsc ds ? FDC37N958FR page 255 rev. 09/01/99 irq and dma enable and disable any time the irq and/or dma channels for a logical device are disabled by a register in that logical device, the irq and/or ndack must be disabled. this is in addition to the irq and ndack disabled by the configuration registers (activate bit cleared or address outside of valid range or the interrupt select register set to 0x00 or the dma channel select register set to 0x04). logical device 0 (fdc) for the following cases, the irq and dack used by the fdc are disabled (high impedance), i.e., will not respond to the dreq 1. digital output register (base+2) bit d3 (dmaen) set to "0". 2. the fdc is in power down (disabled). logical device 5 (serial port1) modem control register (mcr) bit d2 (out2) - when out2 is a logic "0", then the serial port interrupt is forced to a high impedance state - disabled. logical device 5 (serial port2/usart) interrupt is disabled when: modem control register (mcr) bit 2 (out2) - when out2 is a logic ?0?, then logical device 5?s interrupt is forced to a high impedance state, i.e., disabled. this applies to all uart/ir modes of operation. drq is disabled when: usrt configuration register b bit-0 (dma enable) - when the dma enable bit is a logic ?0?, then logical device 5?s drq pin is forced to a high impedance state, i.e., disabled. when the dma enable bit is set to logic ?1?, then logical device 5?s drq pin is active and drives low until the device issues a dma request at which point the drq pin drives high. this eliminates the need for an external pull-down resistor on the logical device 5?s drq pin.
smsc ds ? FDC37N958FR page 256 rev. 09/01/99 parallel port spp and epp modes: control port (base+2) bit d4 (irqe) set to "0", irq is disabled (high impedance). ecp mode: (dma) dmaen from ecr register. irq - see table below. mode (from ecr register) irq pin controlled by pdreq pin controlled by 000 printer irqe dmaen 001 spp irqe dmaen 010 fifo (on) dmaen 011 ecp (on) dmaen 100 epp irqe dmaen 101 res irqe dmaen 110 test (on) dmaen 111 config irqe dmaen real time clock (rtc) (refer to the rtc section) keyboard controller (kybd) (refer to the keyboard controller section)
smsc ds ? FDC37N958FR page 257 rev. 09/01/99 smsc defined logical device configuration registers the smsc specific logical device configuration registers reset to their default values only on hard resets generated by vcc2 por or the reset_out signal. these registers are not effected by soft resets. fdc, logical device 0 [logical device number = 0x00] name reg index definition state fdd mode register default = 0x0e 0xf0 r/w bit[0] floppy mode =0 normal floppy mode (default) =1 enhanced floppy mode 2 (os2) bit[1] fdc dma mode =0 burst mode is enabled =1 non-burst mode (default) bit[3:2] interface mode bit 3 - ident bit 2 - mfm =11 at mode (default) =10 (reserved) =01 ps/2 =00 model 30 bit[4] swap drives 0,1 mode =0 no swap (default) =1 drive and motor sel 0 and 1 are swapped bit[5] fdc shutdown =0 FDC37N958FR fdc operates normally, fdc pins are active (default) =1 fdc core is shutdown, only i/o writes to dor, tdr, dsr and ccr are enabled, all floppy disk interface pins tri-state except for drvden0, drvden1, nds0, nds1, nmtr0, and nmtr1. bit[6] fdc output type control =0 fdc outputs are od24 open drain (default) =1 fdc outputs are o24 push pull bit[7] fdc output control =0 fdc outputs active (default) =1 fdc outputs tri-stated bits 6 and 7 do not reflect the parallel port fdc pins. c
smsc ds ? FDC37N958FR page 258 rev. 09/01/99 name reg index definition state fdd option register default = 0x00 0xf1 r/w bit[1:0] reserved, set to ?0? bit[3-2] density select =00 normal (default) =01 normal (reserved for users) =101 (forced to logic ?1?) =110 (forced to logic ?0?) bit[5:4] media id polarity =00 (default) =01 =10 =11 bit[7:6] boot floppy =00 fdd 0 (default) =01 fdd 1 =10 fdd 2 =11 fdd 3 c fdd type register default = 0xff 0xf2 r/w bit[1:0] floppy drive a type bit[3:2] floppy drive b type bit[5:4] floppy drive c type bit[7:6] floppy drive d type c 0xf3 r reserved, read as 0 (read only) c fdd0 default = 0x00 0xf4 r/w bit[1:0] drive type select bit[2] read as ?0? (read only) bit[3:4] data rate table select bit[5] read as ?0? (read only) bit[6] precomp disable bit[7] read as ?0? (read only) c fdd1 0xf5 r/w refer to definition and default for 0xf4 c
smsc ds ? FDC37N958FR page 259 rev. 09/01/99 dt0 dt1 drvden0 (1) drvden1 (1) drive type 0 0 densel drate0 4/2/1 mb 3.5? 2/1 mb 5.25? fdds 2/1.6/1 mb 3.5? (3-mode) 0 1 drate1 drate0 1 0 ndensel drate0 1 1 drate0 drate1 there are four of the following registers in the configuration data space, one for each drive. fdd0 - 0xf4/fdd1 - 0xf5 d7 d6 d5 d4 d3 d2 d1 d0 0 pts 0 drt1 drt0 0 dt0 dt1 pts = 0 use precompensation = 1 no precompensation dtx = drive type select drtx = data rate table select (1) densel, drate1 and drate0 map onto three output pins drvden0 and drvden1.
smsc ds ? FDC37N958FR page 260 rev. 09/01/99 reserved, logical device 1 [logical device number = 0x01] reserved, logical device 2 [logical device number = 0x02] parallel port, logical device 3 [logical device number = 0x03] name reg index definition state pp mode register default = 0x3c 0xf0 r/w bit [2:0] parallel port mode = 100 printer mode (default) = 000 standard and bi-directional (spp) mode = 001 epp-1.9 and spp mode = 101 epp-1.7 and spp mode = 010 ecp mode = 011 ecp and epp-1.9 mode = 111 ecp and epp-1.7 mode bit[6:3] ecp fifo threshold 0111b (default) bit[7] pp interrupt type not valid when the parallel port is in the printer mode (100) or the standard $ bi-directional mode (000) =1 pulsed low, released to high-z (665/666) =0 irw follows nack when parallel port in epp mode or [printer, spp, epp] under ecp, test or centronics fifo mode. c parallel port cnfgb shadow register default = 0x00 0xf1 r/w bit [2:0] parallel port dma channel select = 000 h/w jumpered 8-bit dma (default) = 001 dma channel 1 = 010 dma channel 2 = 011 dma channel 3 bit [5:3] parallel port irq line select = 000 h/w jumpered irq (default) = 001 irq 7 = 010 irq 9 = 011 irq 10 = 100 irq 11 = 101 irq 14 = 110 irq 15 = 111 irq 5 bit [7:6] reserved, ignores writes returns ?0? on reads. the dma/irq bits in this register are reflected in the enhanced parallel port?s read only cnfgb register. c
smsc ds ? FDC37N958FR page 261 rev. 09/01/99 serial port 1, logical device 4 [logical device number = 0x04] name reg index definition state serial port 1 mode register default = 0x00 0xf0 r/w bit[0] midi mode = 0 midi support disabled (default) = 1 midi support enabled bit[1] high speed = 0 high speed disabled (default) = 1 high speed enabled bit[6:2] reserved, set to ?0? bit[7] share_irq = 0 uarts use different irqs = 1 uarts share a common irq c
smsc ds ? FDC37N958FR page 262 rev. 09/01/99 table 83 - uart shared interrupt operation uart1 uart2 irq pins uart1 out2 bit uart1 irq state uart2 out2 bit uart2 irq state share irq bit uart1 pin state uart2 pin state this part of the table is based on the assumption that both uarts have selected different irq pins. 0z0z0zz 1 asserted 0 z 0 1 z 1 de- asserted 0z00z 0z1asserted0z1 0 z 1 de- asserted 0z0 1 asserted 1 asserted 0 1 1 1 asserted 1 de- asserted 010 1 de- asserted 1 asserted 0 0 1 1 de- asserted 1 de- asserted 000 0z0z1zz 1 asserted 0 z 1 1 1 1 de- asserted 0z100 0 z 1 asserted 1 1 1 0 z 1 de- asserted 100 1 asserted 1 asserted 1 1 1 1 asserted 1 de- asserted 111 1 de- asserted 1 asserted 1 1 1 1 de- asserted 1 de- asserted 100 it is the responsibility of the software to ensure that two irq?s are not set to the same irq number. however, if they are set to the same number than no damage to the chip will result.
smsc ds ? FDC37N958FR page 263 rev. 09/01/99 serial port 2, logical device 5 [logical device number = 0x05] name reg index definition state serial port 2 mode register default = 0x00 oxf0 r/w bit[0] midi mode =0 midi support disabled (default) =1 midi support enabled bit[1] high speed =0 high speed disabled (default) =1 high speed enabled bit[7:2] reserved c ir option register default = 0x00 this register sets the ir options and uses the same bit definitions as the fdc37c93x oxf1 r/w bit[0] receive polarity =0 active high =1 active low (default) bit[1] transmit polarity =0 full duplex (default) =1 half duplex bit[5:3] uart/ir mode =000 standard comm (default) =001 irda sir-a =010 ask-ir =011 (irda sir-b) =100 (irda hdlc) =101 (irda 4ppm) =110 (consumer) =111 (raw ir) bit[7:6] ircc output mux =00 active device to com-rx/com-tx port (default) =01 active device to irrx/irtx port =10 reserved-use aux port not mapped to pins thus both ir and com ports are inactive =11 reserved, all ports are inactive c ir half duplex timeout default = 0x03 0xf2 r/w bit[7:0] these bits set the half duplex time-out for the ir port. this value is 0 to 10ms in 100 " s increments =0x00 blank rx/tx during transmit/receive =0x01 blank tx/tx during xmit/rcv + 100 " s ...... =0x64 blank rx/tx during xmit/rcv +10ms =0x65 - 0xff : reserved en_1 : bits [5:0] of the ir option configuration register must be reconciled with bits[5:0] of the ?usrt configuration register a? control register in the ircc block, detailed in the ircc specification. additionally bits [7:6] of the ir option configuration register must be reconciled with bits[5:4] of the
smsc ds ? FDC37N958FR page 264 rev. 09/01/99 ?usrt configuration register b? control register in the ircc block. the last register written should update the information in both registers. both sets of registers can use common latches to store the information. rtc, logical device 6 [logical device number = 0x06] name reg index definition state rtc mode register default = 0x00 0xf0 r/w bit[0] = 1 : lock cmos ram 80-9fh bit[1] = 1 : lock cmos ram a0-bfh bit[2] = 1 : lock cmos ram c0-dfh bit[3] = 1 : lock cmos ram e0-feh bit[7:4] reserved, set to ?0? once set, bit[3:0] can not be cleared by a write; bits[3:0] are cleared on vcc2 power on reset, vcc2 power off, or upon a hard reset(reset_out asserted). once lock bits are set, both the host and the 8051 are locked out of accessing the locked locations as long as vcc1 and vcc2 are active. when vcc2 goes to 0v, the lock bits are cleared and the 8051 can access this ram while reset_out is asserted. c
smsc ds ? FDC37N958FR page 265 rev. 09/01/99 kbyd, logical device 7 [logical device number = 0x07] name reg index definition state system-to-8051 mailbox register 0x82 r/w note 1 c, r 8051-to-system mailbox register 0x83 r/w note 1 c, r mailbox register 2 - f 0x84-0x91 r/w note 1 c, r pwm0 register 0x92 r/w note 1 c, r pwm1 register 0x93 r/w note 1 c, r 8051stp_clk 0x94 r/w note 1 c, r hmem 0x95 r/w note 1 c, r esmi source register 0x96 r/w note 1 c, r esmi mask register 0x97 r/w note 1 c, r ir data register 0x98 r/w note 1 c, r force disk change register 0x99 r/w see the description of the force disk change register in the fdc section. c, r floppy data rate select shadow register 0x9a r see the description of the floppy data rate select register in the fdc section. c, r uart1 fifo control shadow register 0x9b r this register provides a means of reading uart1?s fifo control register. see the uart section. c, r uart2 fifo control shadow register 0x9c r this register provides a means of reading uart2?s fifo control register. see the uart section. c. r krst_ga20 0xf0 r/w bit[0] : enab_p92 = 0 : port 92 disabled = 1 : port 92 enabled bit [7:0] : reserved, set to ?0?. note 1: refer to the 8051 section for descriptions of these registers.
smsc ds ? FDC37N958FR page 266 rev. 09/01/99 open mode registers below is a concise table of all of the open mode accessible registers on the FDC37N958FR device. open mode registers can be accessed through the chip?s open mode index and data registers and are signified by the prefix idx in front of their hexidecimal address. table 84 - open mode registers open mode index address system r/w 8051 address (7f00 +) 8051 r/w power source vcc1 por vcc2 por zero wait state (1) notes see page # system- to-8051 mailbox register 0 idx 82h r/w 08h rc vcc1 00 y 2 192 8051-to- system mailbox register 1 idx 83h rc 09h r/w vcc1 00 y 3 192 mailbox register [2-f] idx 84h-91h r/w 0a-17h r/w vcc1 00h y 193 pwm0 register idx 92h r/w 25h r/w vcc1 00h y 200 pwm1 register idx 93h r/w 26h r/w vcc1 00h y 200 8051stp _clk idx 94h r/w ------ ----- vcc1 00h y 5 168 hmem idx 95h r/w ----- vcc1 03h 03h y 5, 6 166 esmi source register idx 96h r/w ------ ----- vcc2 00h y 193 esmi mask register idx 97h r/w ------ ----- vcc2 00h y 193 ir data register idx 98h r/w ------ ----- vcc2 00h y 206 force disk change register idx99h r/w ------ ----- vcc2 03h y 278 floppy data rate select shadow register idx9a r ------ ----- vcc2 n/a y 278 uart1 fifo control shadow register idx9b r ------ ----- vcc2 00h y ----- uart2 fifo idx9c r ------ ----- vcc2 00h y -----
smsc ds ? FDC37N958FR page 267 rev. 09/01/99 open mode index address system r/w 8051 address (7f00 +) 8051 r/w power source vcc1 por vcc2 por zero wait state (1) notes see page # control shadow register notes: 1. when accessed for a read or write by the system, the registers marked with a ?y? will drive the zero wait state pin active. 2. interrupt is cleared when read by the 8051. 3. interrupt is cleared when read by the host. 4. when ireset_out is cleared (written from ?1? to?0?) 8051stp_clk bit d0 as well as hmem bits d1 and d0 are all set to ?1?. 5. these registers are reset 500 " s to 1ms following the condition that both vcc2 is valid and pwrgd is asserted given that the rtc is in normal mode and the vrt bit is set (refer to the rtc section). if the rtc is not in normal mode and/or the vrt bit is not set then these registers are reset within 10 " s following the condition that both vcc2 is valid and pwrgd is asserted. system shadow registers the FDC37N958FR makes the following control registers readable by supplying a set of index registers accessable either through logical device 7 when in confuration state or through the open mode index and data registers when in run state. sys. index sys r/w 8051 address (7f00+) 8051 r/w power source vcc1 por vcc2 por zero wait state (9) notes force diskchange idx99 r ------ n/a vcc2 03h ------ floppy data rate select shadow register idx9 a r ------ n/a vcc2 n/a ------ uart1 fifo control shadow register idx9 b r ------ n/a vcc2 00h uart2 fifo control shadow register idx9 c r ------ n/a vcc2 00h
smsc ds ? FDC37N958FR page 268 rev. 09/01/99 floppy data rate select shadow register d7 d6 d5 d4 d3 d2 d1 d0 8051 r/w n/a n/a n/a n/a n/a n/a n/a n/a system r/w rrrrrrrr bit def soft reset power down 0 pre- comp 2 pre- comp 1 pre- comp 0 data rate select 1 data rate select 0 note: d1 and d0 are updated by a write to the floppy data rate or ccr registers. bits d7-d2 are updated by a write to the floppy data rate register only. force diskchange d7-d2 d1 d0 system r/w rr/wr/w bit def reserved 1 = force a diskchange indication when the dir register (of the floppy controller) is read, gated with drive select 0 or 1. these bits can be written to a ?1? but are not clearable by the software. these bits are reset when nstep input is active with the proper drive select to the drive occurs. d0 is cleared on nstep and drive select 0; d1 is cleared on nstep and drive select 1. equivalent logic: when read dir bit 7 = (drive_sel_0 & d0) or (drive_sel_1 & d1) or dsk_chg
smsc ds ? FDC37N958FR page 269 rev. 09/01/99 electrical specifications maximum guaranteed ratings* operating temperature range .................................................................................................... 0 o c to +70 o c storage temperature range .....................................................................................................- 55 o to +150 o c lead temperature range (soldering, 10 seconds).............................................................................. +32 5 o c positive voltage on any pin, with respect to ground .......................................................................... v cc +0.3v negative voltage on any pin, with respect to ground ............................................................................ ..-0.3v maximum v cc ............................................................................................................................... ................ +7v *stresses above those listed above could cause permanent damage to the device. this is a stress rating only and functional operation of the device at any other condition above those indicated in the operation sections of this specification is not implied. note: when powering this device from laboratory or system power supplies, it is important that the absolute maximum ratings not be exceeded or device failure can result. some power supplies exhibit voltage spikes on their outputs when the ac power is switched on or off. in addition, voltage transients on the ac power line may appear on the dc output. if this possibility exists, it is suggested that a clamp circuit be used. table 85 - operating conditions symbol parameter min typ max units vcc0 vbat for rtc vbat for rtc ibat<2a 2.7 3.0 5.5 3.3 v vcc1 vcc for 8051 4.5 5.0 5.5 v vcc2 system vcc 4.5 5.0 5.5 v 32 mhz_in serial comm clock 33 mhz xtal1/xtal2 rtc crystal 32.768 khz 14.31mhz_in system clock 14.318 mhz
smsc ds ? FDC37N958FR page 270 rev. 09/01/99 power distribution table 86 - type 1 device vcc0, ?vbat? (rtc) vcc1 (8051 + other) vcc2 (si/o) 0 volts 0 volts 0 volts powerdown <20 " a 4.7 volts 4.7 volts 0 volts run on 4 mhz 4.7 volts 4.7 volts 0 volts run on 4 mhz 4.7 volts 4.7 volts 5 volts 14 meg input 4.7 volts 4.7 volts 5 volts table 87 - type 2 device vcc0, ?vbat? (rtc) vcc1 (8051 + other) vcc2 (si/o) 0 volts 0 volts 0 volts rtc only <1ua 3.3 volts 0 volts 0 volts powerdown <20 " a 4.7 volts 4.7 volts 0 volts run on 4 mhz 4.7 volts 4.7 volts 0 volts run on 4 mhz 4.7 volts 4.7 volts 5 volts 14 meg input 4.7 volts 4.7 volts 5 volts vcc2 < 3.7v ; lock-out host vcc1 < 2.5v ; lock-out 8051 type 1 device: v cc 0 and v cc 1 tied together and sourced by main battery supply. type 2 device: v cc 0 connected to vbat. v cc 1 connected to main battery supply. v cc 2 is switched supply from either main battery or ac if plugged in.
smsc ds ? FDC37N958FR page 271 rev. 09/01/99 dc specifications dc electrical characteristics (t a = 0c - 70c, v cc = +5.0 v 10%) parameter symbol min typ max units comments i type input buffer low input level high input level v ili v ihi 2.0 0.8 v v ttl levels is type input buffer low input level high input level schmitt trigger hysteresis v ilis v ihis v hys 2.2 250 0.8 v v mv schmitt trigger schmitt trigger isp type input buffer with 90 " " " " a weak pull-up low input level high input level schmitt trigger hysteresis v ilis v ihis v hys 2.2 250 0.8 v v mv schmitt trigger schmitt trigger i clk input buffer low input level high input level v ilck v ihck 3.0 0.4 v v o clk2 crystal oscillator output i clk2 crystal oscillator input use a 32 khz parallel resonant crystal oscillator. the load capacitors are seen by the crystal as two capacitors in series and should be approximately 2 times the co of the actual crystal used (c1=2co). for example, a 7.5pf crystal should use two 15pf capacitors for proper loading. the 1 meg reg resistor (see .6 " a tlm) creates a very low current to bias the xtal1 input to ground and shunt any extraneous dc offset. input leakage (all i and is buffers except pwrgd & vcc1_pwrgd) low input leakage high input leakage i il i ih -10 -10 +10 +10 " a " a v in = 0 v in = v cc input current pwrgd i oh 75 150 ma v in = 0
smsc ds ? FDC37N958FR page 272 rev. 09/01/99 parameter symbol min typ max units comments o4 type buffer low output level high output level output leakage v ol v oh i ol 2.4 -10 0.4 +10 v v " a i ol = 4 ma i oh = -2 ma v in = 0 to v cc od4 type buffer low output level output leakage v ol i oh -10 0.4 +10 v " a v ol = 4 ma i oh = 0 to v cc o8 type buffer low output level high output level output leakage v ol v oh i ol 2.4 -10 0.4 +10 v v " a i ol = 8 ma i oh = -4 ma v in = 0 to v cc od8 type buffer low output level output leakage v ol i oh -10 0.4 +10 v " a v ol = 8 ma i oh = 0 to v cc o24 type buffer low output level high output level output leakage v ol v oh i ol 2.4 -10 0.4 +10 v v " a i ol = 24 ma i oh = -12 ma v in = 0 to v cc od24 type buffer low output level high output level output leakage v ol v oh i ol 2.4 -10 0.4 +10 v v " a i ol = 24 ma i oh = -50 ma v in = 0 to v cc supply current active supply current standby i cc i csby tbd tbd tbd ma " a all outputs open.
smsc ds ? FDC37N958FR page 273 rev. 09/01/99 ac specifications ac test conditions capacitance t a = 25c; fc = 1mhz; v cc = 5v parameter symbol limits unit test condition min typ max clock input capacitance c in 20 pf all pins except pin under test tied to ac ground input capacitance c in 10 pf output capacitance c out 20 pf
smsc ds ? FDC37N958FR page 274 rev. 09/01/99 load capacitance for the timing diagrams shown, the following capacitive loads are used. table 88 - capacitive loading name capacitance total (pf) name capacitance total (pf) sd[0:7] 240 nalf 240 iochrdy 240 nstb 240 irq[1,3,4, 6-8, 12] 120 emclk 240 nsmi 120 emdat 240 drq[0:1] 120 imclk 240 32khz_out 50 imdat 240 24mhz_out 50 kbdat 240 nwgate 240 kbclk 240 nwdata 240 ps2dat 240 nhdsel 240 ps2clk 240 ndir 240 nnows 240 nstep 240 fad[0:7] 100 nds[1:0] 240 fa[8:17] 100 nmtr[1:0] 240 nfrd 50 drvden[1:0] 240 nfwr 50 txd1 100 fale 50 nrts1 100 kso[0:13] 100 ndtr1 100 sirq 150 txd2 100 fpd 50 nrts2 100 ab_data 100 ndtr2 100 ab_clk 100 pd[0:7] 240 irtx 50 nslctin 240 pwm[0:1] 50 ninit 240 nreset_out 240
smsc ds ? FDC37N958FR page 275 rev. 09/01/99 timing diagrams t3 t4 t1 t2 t5 sa[x] sd[7:0] niow figure 30 - fastgatea20 iow timing in order to use the fastgatea20 speed-up mechanism, data must be available by the falling edge of niow. table 89 - fastgatea20 iow timing parameters name description min typ max units t1 sa[x] valid to niow asserted 10 ns t2 sd[7:0] valid to niow asserted 0 ns t3 niow asserted to sa[x] invalid 10 ns t4 niow deasserted to sd[7:0] invalid 0 ns t5 niow deasserted to niow or nior asserted 100 ns
smsc ds ? FDC37N958FR page 276 rev. 09/01/99 figure 31 - isa io write table 90 - isa io write parameters name description min typ max units t1 sa[x] and aen valid to niow asserted 10 ns t2 niow asserted to niow deasserted 80 ns t3 niow asserted to sa[x] invalid 10 ns t4 sd[x] valid to niow deasserted 45 ns t5 sd[x] hold from niow deasserted 0 ns t6 niow deasserted to niow asserted 25 ns t7 niow deasserted to fintr deasserted (note 1) 55 ns t8 niow deasserted to pinter deasserted (note 2) 260 ns t9 ibf (internal signal) asserted from niow deasserted 40 ns t10 niow deasserted to aen invalid 10 ns note 1: fintr refers to the irq used by the floppy disk logical device. note 2: pintr refers to the irq used by the parallel port logical device. t10 t3 t1 t2 t4 t6 t5 t7 t8 t9 data valid aen sa[x] niow sd[x] fintr pintr ibf
smsc ds ? FDC37N958FR page 277 rev. 09/01/99 t13 t3 t1 t7 t2 t6 t4 t5 t10 t9 t11 t12 t8 data vali d aen sa[x] nior sd[x] pd[x], nerror, pe, slct, ack, busy finter pinter pcobf auxobf1 nior/niow figure 32 - isa io read cycle
smsc ds ? FDC37N958FR page 278 rev. 09/01/99 table 91 - isa io read timing parameters name description min typ max units t1 sa[x] and aen valid to nior asserted 10 ns t2 nior asserted to nior deasserted 50 ns t3 nior asserted to sa[x] invalid 10 ns t4 nior asserted to data valid 50 ns t5 data hold/float from nior deasserted 10 25 ns t6 nior deasserted to nior asserted 25 ns t8 nior asserted after niow deasserted 80 ns t8 nior/nior, niow/niow transfers from/to ecp fifo 150 ns t7 parallel port setup to nior asserted 20 ns t9 nior asserted to pinter deasserted 55 ns t10 nior deasserted to finter deasserted 260 ns t11 nior deasserted to pcobf deasserted (notes 3,5) 80 ns t12 nior deasserted to auxobf1 deasserted (notes 4,5) 80 ns t13 nior deasserted to aen invalid 10 ns note 1: fintr refers to the irq used by the floppy disk. note 2: pintr refers to the irq used by the parallel port. note 3: pcobf is used for the keyboard irq. note 4: auxobf1 is used for the mouse irq. note 5: applies only if deassertion is performed in hardware.
smsc ds ? FDC37N958FR page 279 rev. 09/01/99 t2 t1 t2 clocki figure 33 - input clock timing table 92 - input clock timing parameters name description min typ max units t1 clock cycle time for 14.318 mhz 65 ns t2 clock high time/low time for 14.318 mhz 25 ns t r , t f clock rise time/fall time (not shown) 5 ns
smsc ds ? FDC37N958FR page 280 rev. 09/01/99 t15 t2 t3 t12 t16 t1 t4 t5 t6 t11 t14 t8 t7 t9 t10 t13 aen fdrq, pdrq ndack nior or niow data (do-d7) tc data valid figure 34 - dma timing (single transfer mode) table 93 - dma timing (single transfer mode) parameters name description min typ max units t1 ndack delay time from fdrq high 0 ns t2 drq reset delay from nior or niow 100 ns t3 fdrq reset delay from ndack low 100 ns t4 ndack width 150 ns t5 nior delay from fdrq high 0 ns t6 niow delay from fdrq high 0 ns t7 data access time from nior low 100 ns t8 data set up time to niow high 40 ns t9 data to float delay from nior high 10 60 ns t10 data hold time from niow high 10 ns t11 ndack set up to niow/nior low 5 ns t12 ndack hold after niow/nior high 10 ns t13 tc pulse width 60 ns t14 aen set up to nior/niow 40 ns t15 aen hold from ndack 10 ns t16 tc active to pdrq inactive 100 ns
smsc ds ? FDC37N958FR page 281 rev. 09/01/99 t15 t2 t3 t12 t16 t1 t4 t5 t6 t11 t14 t8 t7 t9 t10 t13 aen fdrq, pdrq ndack nior or niow data (do-d7) tc data valid data valid figure 35 - dma timing (burst transfer mode) table 94 - dma timing (burst transfer mode) parameters name description min typ max units t1 ndack delay time from fdrq high 0 ns t2 drq reset delay from nior or niow 100 ns t3 fdrq reset delay from ndack low 100 ns t4 ndack width 150 ns t5 nior delay from fdrq high 0 ns t6 niow delay from fdrq high 0 ns t7 data access time from nior low 100 ns t8 data set up time to niow high 40 ns t9 data to float delay from nior high 10 60 ns t10 data hold time from niow high 10 ns t11 ndack set up to niow/nior low 5 ns t12 ndack hold after niow/nior high 10 ns t13 tc pulse width 60 ns t14 aen set up to nior/niow 40 ns t15 aen hold from ndack 10 ns t16 tc active to pdrq inactive 100 ns
smsc ds ? FDC37N958FR page 282 rev. 09/01/99 t3 t1 t2 t4 t5 t6 t7 t8 t9 t9 ndir nstep nds0-3 nindex nrdata nwdata niow nds0-3, mtr0-3 figure 36 - floppy disk drive timing (at mode) table 95 - floppy disk drive timaing (at mode) parameters name description min typ max units t1 ndir set up to step low 4 x* t2 nstep active time low 24 x* t3 ndir hold time after nstep 96 x* t4 nstep cycle time 132 x* t5 nds0-3 hold time from nstep low 20 x* t6 nindex pulse width 2 x* t7 nrdata active time low 40 ns t8 nwdata write data width low .5 y* t9 nds0-3, mtro-3 from end of niow 25 ns *x specifies one mclk period and y specifies one wclk period. mclk = controller clock to fdc wclk = 2 x data rate
smsc ds ? FDC37N958FR page 283 rev. 09/01/99 t1 t5 t2 t4 t6 t3 niow nrtsx, ndtrx irqx nctsx, ndsrx, ndcdx irqx niow irqx nior nrix figure 37 - serial port timing table 96 - serial port timing parameters name description min typ max units t1 nrtsx, ndtrx delay from niow 200 ns t2 irqx active delay from nctsx, ndsrx, ndcdx 100 ns t3 irqx inactive delay from nior (leading edge) 120 ns t4 irqx inactive delay from niow (trailing edge) 125 ns t5 irqx inactive delay from niow 10 100 ns t6 irqx active delay from nrix 100 ns
smsc ds ? FDC37N958FR page 284 rev. 09/01/99 t1 t4 t3 t2 t2 t5 t3 niow ninit, nstrobe. nautofd, slctin nack pintr (ecp or epp enabled) nfault (ecp) nerror (ecp) pintr pd0- pd7 t6 npintr (spp) figure 38 - parallel port timing table 97 - parallel port timing parameters name description min typ max units t1 pd0-7, ninit, nstrobe, nautofd delay from niow 100 ns t2 pintr delay from nack, nfault 60 ns t3 pintr active low in ecp and epp modes 200 300 ns t4 pintr delay from nack 105 ns t5 nerror active to pintr active 105 ns t6 pd0 - pd7 delay from iow active 100 ns
smsc ds ? FDC37N958FR page 285 rev. 09/01/99 t18 t9 t8 t17 t12 t19 t10 t11 t13 t20 t22 t2 t1 t5 t3 t14 t16 t4 t6 t15 t7 t21 a0-a10 sd<7:0> niow iochrdy nwrite pd<7:0> ndatast naddrstb nwait pdir figure 39 - epp 1.9 data or address write cycle
smsc ds ? FDC37N958FR page 286 rev. 09/01/99 table 98 - epp 1.9 data or address write parameters name description min typ max units t1 niow asserted to pdata valid 0 50 ns t2 nwait asserted to nwrite change (note 1) 60 185 ns t3 nwrite to command asserted 5 35 ns t4 nwait deasserted to command deasserted (note 1) 60 190 ns t5 nwait asserted to pdata invalid (note 1) 0 ns t6 time out 10 12 ms t7 command deasserted to nwait asserted 0 ns t8 sdata valid to niow asserted 10 ns t9 niow deasserted to data invalid 0 ns t10 niow asserted to iochrdy asserted 0 24 ns t11 nwait deasserted to iochrdy deasserted (note 1) 60 160 ns t12 iochrdy deasserted to niow deasserted 10 ns t13 niow asserted to nwrite asserted 0 70 ns t14 nwait asserted to command asserted (note 1) 60 210 ns t15 command asserted to nwait deasserted 0 10 ms t16 pdata valid to command asserted 10 ns t17 ax valid to niow asserted 40 ns t18 niow asserted to ax invalid 10 ns t19 niow deasserted to niow or nior asserted 40 ns t20 nwait asserted to nwrite asserted (note 1) 60 185 ns t21 nwait asserted to pdir low 0 ns t22 pdir low to nwrite asserted 0 ns note 1: nwait must be filtered to compensate for ringing on the parallel bus cable. wait is consideredto have settled after it does not transition for a minimum of 50 nsec.
smsc ds ? FDC37N958FR page 287 rev. 09/01/99 t20 t19 t11 t22 t13 t12 t8 t10 t18 t23 t24 t27 t9 t21 t17 t2 t25 t5 t4 t16 t1 t14 t26 t28 t3 t7 t15 t6 pdata bus driven by peripheral a0-a10 ior sd<7:0> iochrdy pdir nwrite pd<7:0> datastb addrstb nwait figure 40 - epp 1.9 data or address read cycle
smsc ds ? FDC37N958FR page 288 rev. 09/01/99 table 99 - epp 1.9 data or address read cycle timing parameters name description min typ max units t1 pdata hi-z to command asserted 0 30 ns t2 nior asserted to pdata hi-z 0 50 ns t3 nwait deasserted to command deasserted (note 1) 60 180 ns t4 command deasserted to pdata hi-z 0 ns t5 command asserted to pdata valid 0 ns t6 pdata hi-z to nwait deasserted 0 ms t7 pdata valid to nwait deasserted 0 ns t8 nior asserted to iochrdy asserted 0 24 ns t9 nwrite deasserted to nior asserted (note 2) 0 ns t10 nwait deasserted to iochrdy deasserted (note 1) 60 160 ns t11 iochrdy deasserted to nior deasserted 0 ns t12 nior deasserted to sdata hi-z (hold time) 0 40 ns t13 pdata valid to sdata valid 0 75 ns t14 nwait asserted to command asserted 0 195 ns t15 time out 10 12 ms t16 nwait deasserted to pdata driven (note 1) 60 190 ns t17 nwait deasserted to nwrite modified (notes 1,2) 60 190 ns t18 sdata valid to iochrdy deasserted (note 3) 0 85 ns t19 ax valid to nior asserted 40 ns t20 nior deasserted to ax invalid 10 10 ns t21 nwait asserted to nwrite deasserted 0 185 ns t22 nior deasserted to niow or nior asserted 40 ns t23 nwait asserted to pdir set (note 1) 60 185 ns t24 pdata hi-z to pdir set 0 ns t25 nwait asserted to pdata hi-z (note 1) 60 180 ns t26 pdir set to command 0 20 ns t27 nwait deasserted to pdir low (note 1) 60 180 ns t28 nwrite deasserted to command 1 ns note 1: nwait is considered to have settled after it does not transition for a minimum of 50 ns. note 2: when not executing a write cycle, epp nwrite is inactive high. note 3: 85 is true only if t7 = 0.
smsc ds ? FDC37N958FR page 289 rev. 09/01/99 t18 t9 t8 t17 t6 t12 t19 t10 t20 t11 t13 t2 t1 t5 t3 t16 t4 t21 a0-a10 sd<7:0> niow iochrdy nwrite pd<7:0> ndatast naddrstb nwait pdir figure 41 - epp 1.7 data or address write cycle
smsc ds ? FDC37N958FR page 290 rev. 09/01/99 table 100 - epp 1.7 data or address write cycle timing parameters name description min typ max units t1 niow asserted to pdata valid 0 50 ns t2 command deasserted to nwrite change 0 40 ns t3 nwrite to command 5 35 ns t4 niow deasserted to command deasserted (note 2) 50 ns t5 command deasserted to pdata invalid 50 ns t6 time out 10 12 ms t8 sdata valid to niow asserted 10 ns t9 niow deasserted to data invalid 0 ns t10 niow asserted to iochrdy asserted 0 24 ns t11 nwait deasserted to iochrdy deasserted 40 ns t12 iochrdy deasserted to niow deasserted 10 ns t13 niow asserted to nwrite asserted 0 50 ns t16 pdata valid to command asserted 10 35 ns t17 ax valid to niow asserted 40 ns t18 niow deasserted to ax invalid 10 ms t19 niow deasserted to niow or nior asserted 100 ns t20 nwait asserted to iochrdy deasserted 45 ns t21 command deasserted to nwait deasserted 0 ns note 1: nwrite is controlled by clearing the pdir bit to "0" in the control register before performing an epp write. note 2: the number is only valid if nwait is active when iow goes active.
smsc ds ? FDC37N958FR page 291 rev. 09/01/99 t20 t19 t11 t15 t22 t13 t12 t3 t8 t10 t5 t4 t23 t2 t21 a0-a10 nior sd<7:0> iochrdy nwrite pd<7:0> ndatastb naddrstb nwait pdir figure 42 - epp 1.7 data or address read cycle table 101 - epp 1.7 data or address read cycle timing parameters name description min typ max units t2 nior deasserted to command deasserted 50 ns t3 nwait asserted to iochrdy deasserted 0 40 ns t4 command deasserted to pdata hi-z 0 ns t5 command asserted to pdata valid 0 ns t8 nior asserted to iochrdy asserted 24 ns t10 nwait deasserted to iochrdy deasserted 50 ns t11 iochrdy deasserted to nior deasserted 0 ns t12 nior deasserted to sdata high-z (hold time) 0 40 ns t13 pdata valid to sdata valid 40 ns t15 time out 10 12 ms t19 ax valid to nior asserted 40 ns t20 nior deasserted to ax invalid 10 ns t21 command deasserted to nwait deasserted 0 ns t22 nior deasserted to niow or nior asserted 40 ns t23 nior asserted to command asserted 55 ns note: write is controlled by setting the pdir bit to "1" in the control register before performing an epp read.
smsc ds ? FDC37N958FR page 292 rev. 09/01/99 ecp parallel port timing parallel port fifo (mode 101) the standard parallel port is run at or near the peak 500kbytes/sec allowed in the forward direc- tion using dma. the state machine does not examine nack, but begins the next transfer based on busy. refer to figure 32. ecp parallel port timing the timing is designed to allow operation at approximately 2.0 mbytes/sec over a 15ft cable. if a shorter cable is used then the bandwidth will increase. forward-idle when the host has no data to send it keeps hostclk () high and the peripheral will leave periphclk (busy) low. forward data transfer phase the interface transfers data and commands from the host to the peripheral using an interlocked periphack and hostclk. the peripheral may indicate its desire to send data to the host by asserting nperiphrequest. the forward data transfer phase may be entered from the forward-idle phase. while in the forward phase the peripheral may asynchronously assert the nperiphrequest (nfault) to request that the channel be reversed. when the peripheral is not busy it sets periphack (busy) low. the host then sets hostclk (nstrobe) low when it is prepared to send data. the data must be stable for the specified setup time prior to the falling edge of hostclk. the peripheral then sets periphack (busy) high to acknowledge the handshake. the host then sets hostclk (nstrobe) high. the peripheral then accepts the data and sets periphack (busy) low, completing the transfer. this sequence is shown in figure 36. the timing is designed to provide 3 cable round-trip times for data setup if data is driven simultaneously with hostclk (nstrobe). reverse-idle phase the peripheral has no data to send and keeps periphclk high. the host is idle and keeps hostack low. reverse data transfer phase the interface transfers data and commands from the peripheral to the host using an interlocked hostack and periphclk. the reverse data transfer phase may be en- tered from the reverse-idle phase. after the previous byte has beed accepted the host sets hostack (nalf) low. the peripheral then sets periphclk (nack) low when it has data to send. the data must be stable for the specified setup time prior to the falling edge of periphclk. when the host is ready it to accept a byte it sets hostack (nalf) high to acknowledge the handshake. the peripheral then sets periphclk (nack) high. after the host has accepted the data it sets hostack (nalf) low, completing the transfer. this sequence is shown in figure 34.
smsc ds ? FDC37N958FR page 293 rev. 09/01/99 output drivers to facilitate higher performance data transfer, the use of balanced cmos active drivers for critical signals (data, hostack, hostclk, periphack, periphclk) are used ecp mode. because the use of active drivers can present compatibility problems in compatible mode (the control signals, by tradition, are specified as open-collector), the drivers are dynamically changed from open-collector to totem-pole. the timing for the dynamic driver change is specified in the ieee 1284 extended capabilities port protocol and isa interface standard, rev. 1.14, july 14, 1996, available from microsoft. the dynamic driver change must be implemented properly to prevent glitching the outputs.
smsc ds ? FDC37N958FR page 294 rev. 09/01/99 t3 t6 t1 t2 t5 t4 pdata nstrobe busy figure 43 - parallel port fifo timing table 102 - parallel port fifo timing parameters name description min typ max units t1 data valid to nstrobe active 600 ns t2 nstrobe active pulse width 600 ns t3 data hold from nstrobe inactive (note 1) 450 ns t4 nstrobe active to busy active 500 ns t5 busy inactive to nstrobe active 680 ns t6 busy inactive to pdata invalid (note 1) 80 ns note 1: the data is held until busy goes inactive or for time t3, whichever is longer. this only applies if another data transfer is pending. if no other data transfer is pending, the data is held indefinitely.
smsc ds ? FDC37N958FR page 295 rev. 09/01/99 t3 t4 t1 t2 t7 t8 t6 t5 t6 nautofd pdata<7:0> busy nstrobe figure 44 - ecp parallel port forward timing table 103 - ecp parallel port forward timing parameters name description min typ max units t1 nautofd valid to nstrobe asserted 0 60 ns t2 pdata valid to nstrobe asserted 0 60 ns t3 busy deasserted to nautofd changed (notes 1,2) 80 180 ns t4 busy deasserted to pdata changed (notes 1,2) 80 180 ns t5 nstrobe deasserted to busy asserted 0 ns t6 nstrobe deasserted to busy deasserted 0 ns t7 busy deasserted to nstrobe asserted (notes 1,2) 80 200 ns t8 busy asserted to nstrobe deasserted (note 2) 80 180 ns note 1: maximum value only applies if there is data in the fifo waiting to be written out. note 2: busy is not considered asserted or deasserted until it is stable for a minimum of 75 to 130 ns.
smsc ds ? FDC37N958FR page 296 rev. 09/01/99 t2 t1 t5 t6 t4 t3 t4 pdata<7:0> nack nautofd figure 45 - ecp parallel port reverse timing table 104 - ecp parallel port reverse timing name description min typ max units t1 pdata valid to nack asserted 0 ns t2 nautofd deasserted to pdata changed 0 ns t3 nack asserted to nautofd deasserted (notes 1,2) 80 200 ns t4 nack deasserted to nautofd asserted (note 2) 80 200 ns t5 nautofd asserted to nack asserted 0 ns t6 nautofd deasserted to nack deasserted 0 ns note 1: maximum value only applies if there is room in the fifo and terminal count has not been received. ecp can stall by keeping nautofd low. note 2: nack is not considered asserted or deasserted until it is stable for a minimum of 75 to 130 ns.
smsc ds ? FDC37N958FR page 297 rev. 09/01/99 t hd;sta t su;sto t su;sta t su;dat t high t f t r t low t hd;dat t hd;sta t buf ab_data ab_clk figure 46 - access.bus timing table 105 - access.bus timing parameters symbol parameter min. typ. max. unit f scl scl clock frequency 100 khz t buf bus free time 4.7 s t su ; sta start condition set-up time 4.7 s t hd ; sta start condition hold time 4.0 s t low scl low time 4.7 s t high scl high time 4.0 s t r scl and sda rise time 1.0 s t f scl and sda fall time 0.3 s t su ; dat data set-up time 0.25 s t hd ; dat data hold time 0 s t su ; sto stop condition set-up time 4.0 s
smsc ds ? FDC37N958FR page 298 rev. 09/01/99 tsu1 tsu2 t10 t11 t17 t5 t1 t18 t2 t4 t21 t19 t2 t4 t8 t14 t15 t21 t19 t7 t13 t3 t6 t16 t20 t9 t12 a[ 7:0 ] a[ 15:0 ] hmem [ 1:0 ] =a [ 17:16 ] kmem [ 2:1 ] a[ 15:8 ] d [ 7:0 ] d [ 7:0 ] 8051port0 a[ 7:0 ] kmem [ 2:1 ] 8051adr [ 14:8 ] ,k m 8051adr [ 14:8 ] ,kmem [ 0 ] 8051port0 8051stopped sa[15:0] sd[7:0] nrom_cs nmemrd nmemwr fa[17:16] fa[15:8] fad[7:0] iochrdy fale nfrd nfwr figure 47 - host flash read timing
smsc ds ? FDC37N958FR page 299 rev. 09/01/99 table 106 - host flash read timing parameters parameter min typ max units t1 8051 stopped condition met to fa[17:16] sourced by internal register hmem[1:0] 40 ns t2 8051 stopped condition met to fa[15:0] driven by sa[15:0] 40 ns t3 8051 stopped condition met to fale asserted 40 ns t4 sa[15:0] valid to fa[15:0] valid propogation delay 40 ns t5 sa[15:0] valid to nmemrd asserted 88 ns t6 nmemrd asserted to fale de-asserted 21 63 ns t7 nmemrd asserted to iochrdy de-asserted (note1) 24 ns t8 fale de-asserted to fad[7:0] tristated 42 ns t9 fale de-asserted to nfrd asserted 84 ns t10 nmemrd asserted to sd[7:0] driven 30 ns t11 fad[7:0] data valid to sd[7:0] data valid propogation delay 40 ns t12 nfrd, flash read, asserted pulse width (note2) 120 [3 sclk] 200 [5 sclk] ns t13 nfrd de-asserted to iochrdy asserted 0 20 ns t14 fad[7:0] data hold time from nfrd de-asserted 0 ns t15 sa[7:0] muxed onto fad[7:0] following the de- assertion of nfrd 42 ns t16 nfrd de-asserted to fale asserted for next cycle 42 ns t17 sd[7:0] data hold time from nmemrd de-asserted 10 ns t18 8051 clock started condition met to fa[17:16] sourced by internal register kmem[2:1] 40 ns t19 8051 clock started condition met to fa[15] sourced by kmem[0] and fa[14:0] driven by the 8051 40 ns t20 8051 clock started condition met to fale de- asserted 40 ns t21 sa[15:0] invalid to fa[15:0] invalid propagation delay 40 ns tsu1 nrom_cs asserted to nmemrd setup time 20 ns tsu2 fad[7:0] data valid to nfrd de-asserted setup time 20 ns note 1: systems designed prior to the eisa specification, r3.12, which sample chrdy on the rising edge of bclk require that iochrdy is deasserted within 24 ns. note 2: the flash read signal pulse width is programmable through a configuration register, the time values shown are for an internal sclk=24 mhz derived from the 14.318 mhz input.
smsc ds ? FDC37N958FR page 300 rev. 09/01/99 t16 tsu1 t17 t5 t1 t18 t2 t4 t21 t19 t2 t4 t9 t13 t14 t21 t19 t7 t12 t3 t6 t15 t20 t10 t11 a[ 7:0 ] a[ 15:0 ] hmem [ 1:0 ] =a [ 17:16 ] kmem [ 2:1 ] a[ 15:8 ] d [ 7:0 ] d [ 7:0 ] 8051port0 a[ 7:0 ] kmem [ 2:1 ] 8051adr [ 14:8 ] ,k m 8051adr [ 14:8 ] ,kmem [ 0 ] 8051port0 8051stopped sa[15:0] sd[7:0] nrom_cs nmemrd nmemwr fa[17:16] fa[15:8] fad[7:0] iochrdy fale nfrd nfwr figure 48 - host flash write timing
smsc ds ? FDC37N958FR page 301 rev. 09/01/99 table 107 - host flash write timing parameters parameter min typ max units t1 8051 stopped condition met to fa[17:16] sourced by internal register hmem[2:1] 40 ns t2 8051 stopped condition met to fa[15] driven by sa[15:0] 40 ns t3 8051 stopped condition met to fale asserted 40 ns t4 sa[15:0] valid to fa[15:0] valid propogation delay 40 ns t5 sa[15:0] valid to nmemwr asserted 88 ns t6 nmemwr asserted to fale de-asserted 21 63 ns t7 nmemwr asserted to iochrdy de-asserted (note 1) 24 ns t9 fale de-asserted to sd[7:0] driven onto fad[7:0] 42 ns t10 fale de-asserted to nfwr asserted 84 ns t11 nfwr, flash write, asserted pulse width (note 2) 120 [3 sclk] 200 [5 sclk] ns t12 nfwr de-asserted to iochrdy asserted 20 ns t13 fad[7:0] data hold time from nfwr de-asserted 42 ns t14 sa[7:0] muxed onto fad[7:0] following the de- assertion of nfwr 42 ns t15 nfwr deasserted to fale asserted for next cycle 42 ns t16 nmemwr asserted to sd[7:0] valid -10 ns t17 sd[7:0] data hold time from nmemwr de-asserted 10 ns t18 8051 clock started condition met to fa[17:16] sourced by internal register kmem[2:1] 40 ns t19 8051 clock started condition met to fa[15] sourced by kmem[0] and fa[14:0] driven by the 8051 40 ns t20 8051 clock started condition met to fale de- asserted 40 ns t21 sa[15:0] invalid to fa[15:0] invalid propagation delay 40 ns tsu1 nrom_cs asserted to nmemwr setup time 20 ns note 1: systems designed prior to the eisa specification, r3.12, which sample chrdy on the rising edge of bclk require that iochrdy is deasserted within 24 ns. note 2: the flash write signal pulse width is programmable through a configuration register, the time values shown are for an internal sclk=24 mhz derived from the 14.318 mhz input.
smsc ds ? FDC37N958FR page 302 rev. 09/01/99 t1 t12 t11 t2 t3 t9 t4 t5 t6 t7 t8 t10 sa[15:0] aen n ior, niow nnows read data write data figure 49 - zero wait-state (nows) timing table 108 - zero wait-state timing parameters parameter min typ max units t1 aen valid before nior, niow asserted 10 ns t2 sa[15:0] valid before nior asserted 10 ns t3 nior, niow pulse width 80 ns t4 nior, niow asserted to nnows asserted 50 ns t5 nior, niow negated to nnows floated 35 ns t6 nior asserted to read data valid 50 ns t7 nior negated to read data invalid (hold time) 0 ns t8 nior negated to data bus floated 24 ns t9 write data valid before niow deasserted 45 ns t10 niow negated to write data invalid (hold time) 0 ns t11 nior, niow negated to aen invalid 10 ns t12 nior, niow negated to sa[15:0] invalid 10 ns
smsc ds ? FDC37N958FR page 303 rev. 09/01/99 figure 50 - 8051 flash program fetch timing table 109 - 8051 flash program fetch timing parameters parameter min typ max oscillator equation units t1 fale pulse width 127 2t-40 ns t2 address valid to fale low 43 t-40 ns t3 nfrd low to address float 10 10 ns t4 fale low to valid instruction in 234 4t-100 ns t5 fale low to nfrd low 53 t-30 ns t6 nfrd pulse width 205 3t-45 ns t7 nfrd low to valid instruction in 145 3t-105 ns t8 valid instruction hold time following nfrd low-to-high transition 00ns t9 instruction float following nfrd low-to-high transition 59 t-25 ns min and max delays shown for an 8051 clock of 12 mhz, to calculate timing delays for other clock frequencies use the oscillator equations, where t=1/fclk. t2 t1 t5 t6 t3 t4 t7 t8 t9 ins fa[7:0] fa[7:0] fa[17:8] fa[17:8] fale frd fad[7:0] fa[17:8]
smsc ds ? FDC37N958FR page 304 rev. 09/01/99 figure 51 - 8051 flash read timing table 110 - flash read timing parameters parameter min typ max oscillator equation units t1 address valid to fale low 43 t-40 ns t2 address hold following fale low 53 t-30 ns t3 fale low to nfrd low 200 300 3t-50 / 3t+50 ns t4 nfrd pulse width 400 6t-100 ns t5 nfrd high to fale high 43 123 t-40 / t+40 ns t6 nfrd low to valid data in 252 5t-165 ns t7 data hold following nfrd 0 0 ns t8 data float following nfrd 107 2t-60 ns min and max delays shown for an 8051 clock of 12 mhz, to calculate timing delays for other clock frequencies use the oscillator equations, where t=1/fclk. t1 t5 t3 t4 t2 t6 t7 t8 data in fa[17:8] fa[7:0] fa[17:8] fa[7:0 fale nfrd fad[7:0] fa[17:8]
smsc ds ? FDC37N958FR page 305 rev. 09/01/99 t6 t1 t5 t3 t4 t2 t7 fa[17:8] data out fa[17:8] fa[7:0] fa[7:0] fale nfwr fad[7:0] fa[17:8] figure 52 - 8051 flash write timing table 111 - flash write timing parameters parameter min typ max oscillator equation units t1 address valid to fale low 43 t-40 ns t2 address hold following fale low 53 t-30 ns t3 fale low to nfwr low 200 300 3t-50 / 3t+50 ns t4 nfwr pulse width 400 6t-100 ns t5 nfwr high to fale high 43 123 t-40 / t+40 ns t6 data valid to nfwr falling edge 33 t-50 ns t7 data hold following nfwr 33 t-50 ns min and max delays shown for an 8051 clock of 12mhz, to calculate timing delays for other clock frequencies use the oscillator equations, where t=1/fclk.
smsc ds ? FDC37N958FR page 306 rev. 09/01/99 a a1 a2 d d1 e e1 h l min 0.05 3.17 30.35 27.90 30.35 27.90 0.09 0.35 nom 30.60 28.00 30.60 28.00 0.50 max 4.07 0.5 3.67 30.85 28.10 30.85 28.10 0.230 0.65 nom 1.30 0.50bsc 0.20 or 0.15 0.30 or 0.20 min 0 0.10 max 7 0.30 l1 e 0 w r1 r2 notes: 1) coplanarity is 0.080 mm maximum 2) tolerance on the position of the leads is 0.080 mm maximum 3) package body dimensions d1 and e1 do not include the mold protrusion. maximum mold protrusion is 0.25 mm 4) dimensions for foot length l when measured at the centerline of the leads are given at the table. dimension for foot length l when measured at the gauge plane 0.25 mm above the seating plane, is 0.6 mm 5) details of pin 1 identifier are optional but must be located within the zone indicated 6) controlling dimension: millimeter figure 53 - 208 pin qfp package outline
smsc ds ? FDC37N958FR page 307 rev. 09/01/99 a a1 a2 d d1 e e1 h min 0.05 1.35 29.90 27.90 29.90 27.90 0.09 nom 30.00 28.00 30.00 28.00 max 1.6 0.15 1.45 30.10 28.10 30.10 28.10 0.230 n o m 0.60 1.00 0.50bsc min 0.45 0 0.17 0.08 0.08 max 0.75 7 0.27 0.20 0.08 l l1 e 0 w r1 r2 ccc notes: 1) coplanarity is 0.080 mm or 3.2 mils maximum 2) tolerance on the position of the leads is 0.080 mm maximum 3) package body dimensions d1 and e1 do not include the mold protrusion. maximum mold protrusion is 0.25 mm 5) details of pin 1 identifier are optional but must be located within the zone indicated 6) c ontrolling dim ension: m illim eter 4) dimensions for foot length l measured at the gauge plane 0.25 mm above the seating plane figure 54 - 208 pin tqfp package outline
smsc ds ? FDC37N958FR page 308 rev. 09/01/99 functional revision addendum functional revision device revision reg value see datasheet pages description b&c 01h 138, 139, 141,142, 189, 241, 244, 246 1. device reg value = 01h 2. led reg is powered by vcc1. the data contents remains undefined until vcc2 por. d 08h 138, 139, 141,142, 189, 241, 244, 246 1. device reg value = 08 2. led reg is powered by vcc1. when vcc1 por the data contents default is accessible. vcc2 por has no impact on this register.
smsc ds ? FDC37N958FR page 309 rev. 09/01/99 FDC37N958FR errata sheet page section/figure/entry correction date revised 138 table 56 see italicized text 9/1/99 139 table 56 see italicized text 9/1/99 141 note 13 added see italicized text 9/1/99 142 device rev register 01h changed to see note 9/1/99 142 device rev register note added 9/1/99 189 led register 0x00 changed to see note 2 9/1/99 189 note 2 added see italicized text 9/1/99 241 table 77 see italicized text 9/1/99 244 note 4 added see italicized text 9/1/99 246 table 78 see italicized text 9/1/99 308 functional revision addendum new page 9/1/99
? 1999 standard microsystems corporation (smsc) circuit diagrams utilizing smsc products are included as a means of illustrating typical applications; consequently complete in formation sufficient for construction purposes is not necessarily given. the information has been carefully checked and is believed to b e entirely reliable. however, no responsibility is assumed for inaccuracies. furthermore, such information does not convey to the purcha ser of the semiconductor devices described any licenses under the patent rights of smsc or others. smsc reserves the right to make changes at any time in order to improve design and supply the best product possible. smsc products are not designed, intended, authorized or w arranted for use in any life support or other application where product failure could cause or contribute to personal injury or severe p roperty damage. any and all such uses without prior written approval of an officer of smsc and further testing and/or modification will be full y at the risk of the customer. FDC37N958FR rev. 9/01/99


▲Up To Search▲   

 
Price & Availability of FDC37N958FR

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X